305 lines
11 KiB
RPMSpec
305 lines
11 KiB
RPMSpec
#
|
|
# spec file for package wildfly
|
|
#
|
|
# Copyright (c) 2024 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: wildfly
|
|
Version: 26.0.0
|
|
Release: 0
|
|
Summary: JEE 7 and 8 Application Server
|
|
License: APSL-2.0 AND LGPL-2.1-only AND GPL-2.0-only
|
|
Group: Productivity/Networking/Web/Servers
|
|
URL: https://wildfly.org/
|
|
Source0: https://github.com/wildfly/wildfly/releases/download/%{version}.Final/wildfly-%{version}.Final.tar.gz
|
|
Source1: %{name}-Documentation-v1-20180305_0409.pdf
|
|
Source3: %{name}.sysconfig
|
|
Source99: %{name}.rpmlintrc
|
|
Patch0: %{name}-systemd.patch
|
|
BuildRequires: dos2unix
|
|
BuildRequires: fdupes
|
|
BuildRequires: systemd
|
|
Requires: java-headless >= 11
|
|
Requires(pre): shadow
|
|
Provides: jboss-as = %{version}
|
|
%{?systemd_requires}
|
|
|
|
%description
|
|
WildFly, formerly known as JBoss AS, or simply JBoss, is an application server authored by JBoss,
|
|
now developed by Red Hat. WildFly is written in Java, and implements the Java Platform, Enterprise Edition
|
|
(Java EE) specification, JEE 7 and JEE 8.
|
|
|
|
%package doc
|
|
Summary: JEE Application Server Documentation
|
|
Group: Documentation/Other
|
|
|
|
%description doc
|
|
Documentation and examples for JEE Application Server wildfly.
|
|
|
|
%prep
|
|
%setup -q -n wildfly-%{version}.Final
|
|
%patch -P 0 -p1
|
|
# remove unneeded files
|
|
find . type -f -name *.exe | xargs rm -f
|
|
find . type -f -name *.bat | xargs rm -f
|
|
# we don't want windows, MacOS, and Solaris things
|
|
rm -rf docs/contrib/scripts/service
|
|
rm -rf modules/system/layers/base/org/wildfly/openssl/main/lib/win*
|
|
rm -rf modules/system/layers/base/org/wildfly/openssl/main/lib/macosx*
|
|
rm -rf modules/system/layers/base/org/wildfly/openssl/main/lib/solaris*
|
|
|
|
%build
|
|
# nothing to build
|
|
|
|
%install
|
|
# bytecode has been compiled for java > 1.5, so suppress message (and error)
|
|
export NO_BRP_CHECK_BYTECODE_VERSION=true
|
|
|
|
## "home" folder
|
|
for prog in bin/*.sh; do
|
|
#install -D -m755 $prog %%{buildroot}%{_localstatedir}/lib/%%{name}/bin/$(basename $prog .sh)
|
|
install -D -m755 $prog %{buildroot}%{_localstatedir}/lib/%{name}/bin/$prog
|
|
done
|
|
for file in bin/*.conf bin/*.properties bin/.jbossclirc; do
|
|
install -D -m644 $file %{buildroot}%{_localstatedir}/lib/%{name}/$file
|
|
done
|
|
|
|
cp -a bin/client %{buildroot}%{_localstatedir}/lib/%{name}/bin
|
|
cp -a modules %{buildroot}%{_localstatedir}/lib/%{name}
|
|
install -m644 jboss-modules.jar %{buildroot}%{_localstatedir}/lib/%{name}
|
|
|
|
## doc
|
|
install -d -m755 %{buildroot}%{_docdir}/%{name}
|
|
install -D -m644 %{SOURCE1} %{buildroot}%{_docdir}/%{name}/%{name}-11-documentation.pdf
|
|
cp -a docs/* %{buildroot}%{_docdir}/%{name}/
|
|
install -m644 LICENSE.txt %{buildroot}%{_docdir}/%{name}/LICENSE
|
|
install -m644 README.txt %{buildroot}%{_docdir}/%{name}/README
|
|
install -m644 copyright.txt %{buildroot}%{_docdir}/%{name}/COPYRIGHT
|
|
|
|
find %{buildroot}%{_docdir}/%{name} -type f -print0 | xargs -0 dos2unix
|
|
|
|
## install sysconfig
|
|
%if 0%{?suse_version} < 1500
|
|
install -d -m 755 %{buildroot}%{_localstatedir}/adm/fillup-templates/
|
|
install -D -m644 %{SOURCE3} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
|
|
%else
|
|
install -d -m 755 %{buildroot}%{_fillupdir}/
|
|
install -D -m644 %{SOURCE3} %{buildroot}%{_fillupdir}/sysconfig.%{name}
|
|
%endif
|
|
|
|
# configurations
|
|
for f in domain standalone appclient; do
|
|
install -d -m755 %{buildroot}%{_sysconfdir}/%{name}/$f
|
|
install -m644 -t %{buildroot}%{_sysconfdir}/%{name}/$f $f/configuration/*
|
|
install -d -m755 %{buildroot}%{_localstatedir}/lib/%{name}/$f
|
|
install -d -m755 %{buildroot}%{_sysconfdir}/%{name}/$f
|
|
ln -snf %{_sysconfdir}/%{name}/$f %{buildroot}%{_localstatedir}/lib/%{name}/$f/configuration
|
|
done
|
|
install -m644 bin/jboss-cli.xml %{buildroot}%{_sysconfdir}/%{name}
|
|
ln -snf %{_sysconfdir}/%{name}/jboss-cli.xml %{buildroot}%{_localstatedir}/lib/%{name}/bin/jboss-cli.xml
|
|
install -d -m755 %{buildroot}%{_bindir}
|
|
|
|
cat << 'EOF' > %{buildroot}%{_bindir}/jboss-cli
|
|
#!/bin/bash
|
|
exec %{_localstatedir}/lib/%{name}/bin/jboss-cli "$@"
|
|
EOF
|
|
chmod +x %{buildroot}%{_bindir}/jboss-cli
|
|
|
|
## install systemd service
|
|
install -d -m755 %{buildroot}%{_sbindir}
|
|
install -D -m755 docs/contrib/scripts/systemd/launch.sh %{buildroot}%{_localstatedir}/lib/wildfly/bin/launch.sh
|
|
install -D -m644 docs/contrib/scripts/systemd/wildfly.service %{buildroot}%{_unitdir}/%{name}.service
|
|
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcwildfly
|
|
|
|
### SuSEfirewall
|
|
%if 0%{?suse_version} < 1500
|
|
install -d -m755 %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/
|
|
cat << 'EOF' > %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
|
|
## Name: WildFly
|
|
## Description: JEE 7 Application Server
|
|
TCP="8080 9990"
|
|
EOF
|
|
%endif
|
|
|
|
# welcome content
|
|
cp -a welcome-content %{buildroot}%{_localstatedir}/lib/%{name}/
|
|
|
|
## misc
|
|
install -d -m700 %{buildroot}%{_localstatedir}/cache/%{name}/auth
|
|
install -d -m775 %{buildroot}%{_localstatedir}/cache/%{name}/domain/tmp
|
|
install -d -m775 %{buildroot}%{_localstatedir}/cache/%{name}/domain/tmp/auth
|
|
install -d -m775 %{buildroot}%{_localstatedir}/cache/%{name}/domain/servers
|
|
install -d -m775 %{buildroot}%{_localstatedir}/cache/%{name}/standalone/tmp
|
|
install -d -m775 %{buildroot}%{_localstatedir}/cache/%{name}/standalone/tmp/auth
|
|
install -d -m755 %{buildroot}%{_prefix}/lib/tmpfiles.d
|
|
|
|
cat << EOF > %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
|
|
d %{_localstatedir}/run/%{name} 775 root wildfly
|
|
EOF
|
|
|
|
for f in standalone domain; do
|
|
install -d -m775 %{buildroot}%{_localstatedir}/log/%{name}/$f
|
|
install -d -m755 %{buildroot}%{_localstatedir}/lib/%{name}/$f
|
|
install -d -m775 %{buildroot}%{_localstatedir}/lib/%{name}/$f/data
|
|
install -d -m775 %{buildroot}%{_localstatedir}/lib/%{name}/$f/data/content
|
|
install -d -m775 %{buildroot}%{_localstatedir}/lib/%{name}/$f/deployments
|
|
install -d -m775 %{buildroot}%{_localstatedir}/lib/%{name}/$f/lib
|
|
install -d -m775 %{buildroot}%{_localstatedir}/lib/%{name}/$f/lib/ext
|
|
install -d -m775 %{buildroot}%{_localstatedir}/lib/%{name}/$f/
|
|
|
|
ln -s %{_localstatedir}/log/%{name} %{buildroot}%{_localstatedir}/lib/%{name}/$f/log
|
|
ln -s %{_localstatedir}/cache/%{name}/$f/tmp %{buildroot}%{_localstatedir}/lib/%{name}/$f/tmp
|
|
|
|
# configuration history
|
|
for x in %{buildroot}%{_sysconfdir}/%{name}/$f/*.xml; do
|
|
histdir=$(basename $x .xml)_xml_history
|
|
install -d -m775 %{buildroot}%{_localstatedir}/cache/%{name}/$f/$histdir
|
|
ln -snf %{_localstatedir}/cache/%{name}/$f/$histdir %{buildroot}%{_sysconfdir}/%{name}/$f/$histdir
|
|
done
|
|
done
|
|
ln -s %{_localstatedir}/cache/%{name}/domain/servers %{buildroot}%{_localstatedir}/lib/%{name}/domain/servers
|
|
|
|
# patch files
|
|
%if 0%{?suse_version} < 1500
|
|
sed -i -e 's|@_lib@|%{_lib}|g' %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
|
|
%else
|
|
sed -i -e 's|@_lib@|%{_lib}|g' %{buildroot}%{_fillupdir}/sysconfig.%{name}
|
|
%endif
|
|
|
|
# rpmlint
|
|
%fdupes %{buildroot}%{_var}
|
|
%fdupes %{buildroot}%{_docdir}
|
|
|
|
%pre
|
|
if ! getent group %{name} >/dev/null; then
|
|
groupadd -r %{name}
|
|
fi
|
|
if ! getent passwd %{name} >/dev/null; then
|
|
useradd -r -g %{name} -d %{_var}/lib/%{name} -c "WildFly Application Server" %{name} -s /sbin/nologin
|
|
else
|
|
true
|
|
fi
|
|
%service_add_pre %{name}.service
|
|
|
|
%post
|
|
%service_add_post %{name}.service
|
|
%restart_on_update %{name}
|
|
%fillup_only %{name}
|
|
# create /var/run/wildfly
|
|
%if 0%{?suse_version} <= 1320
|
|
systemd-tmpfiles --create %{_prefix}/lib/tmpfiles.d/%{name}.conf
|
|
%else
|
|
%tmpfiles_create %{_prefix}/lib/tmpfiles.d/%{name}.conf
|
|
%endif
|
|
|
|
%preun
|
|
%service_del_preun %{name}.service
|
|
%stop_on_removal %{name}
|
|
# remove logfiles,...
|
|
if [ $1 -eq 0 ]; then
|
|
rm -f %{_localstatedir}/log/%{name}/* 2>/dev/null
|
|
for f in standalone domain; do
|
|
rm -rf %{_localstatedir}/lib/%{name}/$f/data/*
|
|
rm -rf %{_localstatedir}/cache/%{name}/$f/tmp/*
|
|
done
|
|
rm -rf %{_sysconfdir}/%{name}/*/*_xml_history/*
|
|
rm -rf %{_localstatedir}/cache/%{name}/domain/servers/*
|
|
else
|
|
true
|
|
fi
|
|
|
|
%postun
|
|
%service_del_postun %{name}.service
|
|
# Remove user and group
|
|
if [ $1 -eq 0 ]; then
|
|
userdel -f %{name}
|
|
groupdel %{name}
|
|
rm -f %{_sysconfdir}/sysconfig/%{name}
|
|
else
|
|
true
|
|
fi
|
|
|
|
%files
|
|
%defattr(-,root,wildfly)
|
|
%{_var}/lib/%{name}
|
|
%{_var}/lib/%{name}/domain
|
|
%{_var}/lib/%{name}/standalone
|
|
%config(noreplace) %{_sysconfdir}/%{name}/jboss-cli.xml
|
|
%dir %{_docdir}/%{name}
|
|
%doc %{_docdir}/%{name}/README
|
|
%doc %{_docdir}/%{name}/COPYRIGHT
|
|
%license %{_docdir}/%{name}/LICENSE
|
|
%doc %{_docdir}/%{name}/contrib/
|
|
%doc %{_docdir}/%{name}/licenses/
|
|
%{_bindir}/jboss-cli
|
|
%{_prefix}/lib/systemd/system/%{name}.service
|
|
%{_sbindir}/rc%{name}
|
|
%if 0%{?suse_version} < 1500
|
|
%{_localstatedir}/adm/fillup-templates/sysconfig.wildfly
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
|
|
%else
|
|
%{_fillupdir}/sysconfig.wildfly
|
|
%endif
|
|
%defattr(0644,root,wildfly,0775)
|
|
%if 0%{?suse_version} >= 1220
|
|
%attr(0644,root,root) %{_prefix}/lib/tmpfiles.d/%{name}.conf
|
|
%else
|
|
%attr(0775,root,wildfly) %dir %{_var}/run/%{name}
|
|
%endif
|
|
%dir %{_var}/cache/%{name}
|
|
%dir %{_sysconfdir}/%{name}
|
|
%dir %{_sysconfdir}/%{name}/appclient
|
|
%defattr(0664,root,wildfly,0775)
|
|
%dir %{_var}/log/%{name}
|
|
%defattr(0600,wildfly,wildfly)
|
|
%config(noreplace) %{_sysconfdir}/%{name}/appclient/logging.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/domain/application-roles.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/domain/application-users.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/domain/mgmt-groups.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/domain/mgmt-users.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/domain/default-server-logging.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/domain/logging.properties
|
|
%defattr(0664,wildfly,wildfly)
|
|
%config(noreplace) %{_sysconfdir}/%{name}/domain/*.xml
|
|
%config(noreplace) %{_sysconfdir}/%{name}/appclient/*.xml
|
|
%config(noreplace) %{_sysconfdir}/%{name}/standalone/application-roles.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/standalone/application-users.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/standalone/mgmt-groups.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/standalone/mgmt-users.properties
|
|
%config(noreplace) %{_sysconfdir}/%{name}/standalone/logging.properties
|
|
%defattr(0644,wildfly,wildfly)
|
|
%config(noreplace) %{_sysconfdir}/%{name}/standalone/*.xml
|
|
%defattr(0700,wildfly,wildfly)
|
|
%dir %{_var}/cache/%{name}/auth
|
|
%defattr(0660,root,wildfly,0775)
|
|
%dir %{_var}/cache/%{name}/domain
|
|
%dir %{_var}/cache/%{name}/domain/*
|
|
%{_sysconfdir}/%{name}/domain/*_xml_history
|
|
%dir %{_sysconfdir}/%{name}/domain
|
|
%dir %{_var}/cache/%{name}/standalone
|
|
%dir %{_var}/cache/%{name}/standalone/*
|
|
%{_sysconfdir}/%{name}/standalone/*_xml_history
|
|
%dir %{_sysconfdir}/%{name}/standalone
|
|
%defattr(0770,root,wildfly)
|
|
%dir %{_var}/log/%{name}/domain
|
|
%dir %{_var}/log/%{name}/standalone
|
|
|
|
%files doc
|
|
%doc %{_docdir}/%{name}/examples
|
|
%doc %{_docdir}/%{name}/schema
|
|
%doc %{_docdir}/%{name}/%{name}-11-documentation.pdf
|
|
|
|
%changelog
|