Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions SPECS-EXTENDED/apache-commons-jexl/apache-commons-jexl.spec
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Summary: Java Expression Language (JEXL)
Name: apache-%{short_name}
Version: 2.1.1
Release: 3%{?dist}
Release: 4%{?dist}
License: Apache-2.0
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand Down Expand Up @@ -108,14 +108,40 @@ ln -sf %{name}/%{short_name}-compat.jar %{buildroot}%{_javadir}/%{short_name}-co
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{short_name}.pom
%add_maven_depmap %{name}/%{short_name}.pom %{name}/%{short_name}.jar
install -pm 0644 jexl2-compat/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{short_name}-compat.pom
install -pm 0644 jexl2-compat/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{short_name}-compat.pom
%add_maven_depmap %{name}/%{short_name}-compat.pom %{name}/%{short_name}-compat.jar
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/jexl2-compat
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/
cp -pr jexl2-compat/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/jexl2-compat/

# Extract LICENSE if present
legaldir=%{buildroot}%{_javadocdir}/%{name}/legal
if [ -d "$legaldir" ]; then
install -Dm 0644 $legaldir/LICENSE \
%{buildroot}%{_licensedir}/apache-commons-jexl/LICENSE.javadoc
fi

# Delete ALL legal/ dirs
find %{buildroot}%{_javadocdir}/%{name} -type d -name legal -exec rm -rf {} +

# Run fdupes (this may create new symlinks)
%fdupes -s %{buildroot}%{_javadocdir}

# Fix absolute symlinks inside jexl2-compat by rewriting relative to parent directory structure
pushd %{buildroot}%{_javadocdir}/%{name}
for f in $(find jexl2-compat -type l); do
tgt=$(readlink "$f")
if [[ "$tgt" = /* ]]; then
base=$(basename "$tgt")
# Compute depth-aware relative path
depth=$(dirname "$f" | awk -F/ '{ print NF-1 }')
rel=$(printf '../%.0s' $(seq 1 $depth))"$base"
ln -snf "$rel" "$f"
fi
done
popd

%check
# commons-jexl
%{ant} \
Expand All @@ -128,16 +154,20 @@ cp -pr jexl2-compat/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/jex
test

%files -f .mfiles
%license LICENSE.txt
%doc NOTICE.txt RELEASE-NOTES.txt
%license LICENSE.txt NOTICE.txt
%doc RELEASE-NOTES.txt
%{_javadir}/%{short_name}*.jar

%files javadoc
%license LICENSE.txt
%doc NOTICE.txt
%license %{_licensedir}/apache-commons-jexl/LICENSE.javadoc
%{_javadocdir}/%{name}

%changelog

* Mon Dec 22 2025 Aninda Pradhan <v-anindap@microsoft.com> - 2.1.1-4
- Fixed license path warnings
- License verified

* Mon Nov 14 2022 Sumedh Sharma <sumsharma@microsoft.com> - 2.1.1-3
- Fix build errors
* create 'Packages' directory under JDK_HOME
Expand Down
33 changes: 29 additions & 4 deletions SPECS-EXTENDED/javacc/javacc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Distribution: Azure Linux
Summary: A Parser and Scanner Generator for Java
Name: javacc
Version: 7.0.4
Release: 3%{?dist}
Release: 4%{?dist}
License: BSD-3-Clause
Group: Development/Libraries/Java
URL: http://javacc.org
Expand Down Expand Up @@ -84,7 +84,7 @@ find ./examples -type f -exec sed -i 's/\r//' {} \;

%build
%{ant} \
-Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
-Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 \
jar javadoc

%install
Expand All @@ -99,12 +99,31 @@ install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/javadoc/* %{buildroot}%{_javadocdir}/%{name}/

# Move license-like files out of javadoc tree to avoid license warnings
legaldir=%{buildroot}%{_javadocdir}/%{name}/legal

if [ -d "$legaldir" ]; then
# install renamed copies into licensedir
install -Dm 0644 $legaldir/LICENSE \
%{buildroot}%{_licensedir}/javacc/LICENSE.javadoc

install -Dm 0644 $legaldir/ADDITIONAL_LICENSE_INFO \
%{buildroot}%{_licensedir}/javacc/ADDITIONAL_LICENSE_INFO.javadoc

# remove the originals to avoid confusion
rm -rf $legaldir
fi

# Remove all javadoc legal directories afterward
find %{buildroot}%{_javadocdir}/%{name} -type d -name legal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there is one warning for javacc -

time="2025-12-24T14:52:18Z" level=debug msg=" absolute symlink: /usr/bin/javacc.sh -> /usr/bin/javacc"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandeepkarambelkar Fixed the symlink warning issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandeepkarambelkar The buddybuild result looks good

%fdupes -s %{buildroot}%{_javadocdir}
%fdupes -s www
%fdupes -s examples

%jpackage_script javacc '' '' javacc javacc true
ln -s %{_bindir}/javacc %{buildroot}%{_bindir}/javacc.sh
ln -s javacc %{buildroot}%{_bindir}/javacc.sh
%jpackage_script jjdoc '' '' javacc jjdoc true
%jpackage_script jjtree '' '' javacc jjtree true

Expand All @@ -124,9 +143,15 @@ ln -s %{_bindir}/javacc %{buildroot}%{_bindir}/javacc.sh

%files javadoc
%license LICENSE
%{_javadocdir}/%{name}
%doc %{_javadocdir}/%{name}
%license %{_licensedir}/javacc/*

%changelog
* Wed Dec 17 2025 Aninda Pradhan <v-anipradhan@microsoft.com> - 7.0.4-4
- Updated javac to use 1.8 to resolve build issues.
- Fixed license path warnings
- License verified

* Sat Jul 24 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 7.0.4-3
- Splitting as separate 'javacc' package with a build-time dependency on 'javacc-bootstrap'.
- Switching to using single digit 'Release' tags.
Expand Down
Loading