LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File jboss6.spec of Package jboss6 (Project home:ecsos:server)

#
# spec file for package jboss 6
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%if 0%{?suse_version} < 1500
%define _fillupdir /var/adm/fillup-templates
%endif

%define real_name	jboss
%define prefix		/srv/jboss/%{version}


Name:           jboss6
Summary:        JBoss Applicationserver 6.1.0.
License:        LGPL-2.1
Group:          Productivity/Networking/Web/Servers
Version:        6.1.0
Release:        1
Source0:        jboss-as-distribution-%{version}.Final.zip
Source1:        %{name}.sysinit
Source2:        %{name}.sysconfig
Source3:        %{name}.systemd
Source99:       jboss6.rpmlintrc
Url:            http://www.jboss.org/
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

PreReq: 		%fillup_prereq

# manual requires only
AutoReqProv:           off
Requires:              jre >= 1.7.0

# needed for brp-check-bytecode-version (jar, fastjar would do as well)  
BuildRequires:  unzip
BuildRequires:  -post-build-checks


%description
The open source Java Applicationserver.


%prep
%setup -q -n %{real_name}-%{version}.Final
# rpmlint script-without-shebang
chmod -x bin/README-service.txt
chmod -x bin/run.conf
chmod -x bin/logging.properties


%build
echo "no build process needed" 

 
%install
# suppress bytecode version error
export NO_BRP_CHECK_BYTECODE_VERSION=true

%{__mkdir_p} %{buildroot}%{prefix}
for D in bin client common docs lib server
do
  cp -a $D %{buildroot}%{prefix}
done

# install missing dir log
install -d -m755 %{buildroot}%{prefix}/log

# remove unneeded .bat files
rm %{buildroot}/%{prefix}/bin/*.bat

# sysinit
install -d -m755 $RPM_BUILD_ROOT/usr/sbin/
install -D -m644 %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/systemd/system/%{name}.service
install -D -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/%{name} 
install -D -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_fillupdir}/sysconfig.%{name}
ln -snf %{_sysconfdir}/init.d/%{name} $RPM_BUILD_ROOT/usr/sbin/rc%{name}

# generate config-files list
find -type f | grep '\.xml' | grep common | sed -e 's:\./:/:g' | sed -e 's:^:%config(noreplace) %{prefix}:g' >> FILELIST.common.config
find -type f | grep '\.xml' | grep server | sed -e 's:\./:/:g' | sed -e 's:^:%config(noreplace) %{prefix}:g' >> FILELIST.server.config
echo "%defattr(0660,jboss,daemon)" > FILELIST.config
cat FILELIST.common.config FILELIST.server.config >> FILELIST.config

%pre
# add user and group
if ! getent group jboss >/dev/null; then
	groupadd  -r jboss
fi    
if ! getent passwd jboss >/dev/null; then
  useradd -r -g daemon -d /srv/jboss -c "JBoss Application Server" jboss -s /sbin/nologin
fi
%service_add_pre %{name}.service

%post
%service_add_post %{name}.service
%fillup_only

%preun
# systemd
%service_del_preun %{name}.service
# init.d
%stop_on_removal %{name}

%postun
# systemd
%service_del_postun %{name}.service
# init.d
%restart_on_update %{name}
%insserv_cleanup

%files -f FILELIST.config
%defattr(-,root,root)
%doc docs README.txt LICENSE.txt copyright.txt jar-versions.xml
%{_sysconfdir}/init.d/%{name}
%{_sbindir}/rcjboss6
%{_unitdir}/jboss6.service
%{_fillupdir}/sysconfig.%name
%defattr(-,jboss,daemon)
%dir %{prefix}
%config(noreplace) %{prefix}/bin/run.conf
%config(noreplace) %{prefix}/server/default/conf/*xml
# configs
%config(noreplace) %{prefix}/server/default/conf/props/*properties
%config(noreplace) %{prefix}/server/default/deploy/*xml
%config(noreplace) %{prefix}/server/default/deploy/hornetq/*xml
%config(noreplace) %{prefix}/server/default/deployers/jbossws.deployer/META-INF/*xml
# 
%{prefix}/bin
%{prefix}/client
%{prefix}/common
%{prefix}/docs
%{prefix}/lib
%{prefix}/log
%{prefix}/server


%changelog