File jetty5.spec of Package jetty5

#
# spec file for package jetty5 (Version 5.1.14)
#
# Copyright (c) 2009 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/
#


%define with()          %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%define without()       %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
%define bcond_with()    %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
%define _with_bootstrap 1
%bcond_with             bootstrap
%bcond_with             extra
%bcond_with             test
%define bootstrap %{?_with_bootstrap:1}%{!?_with_bootstrap:%{?_without_bootstrap:0}%{!?_without_bootstrap:%{?_bootstrap:%{_bootstrap}}%{!?_bootstrap:0}}}
%define section         free
%define jettyname       jetty
%define jtuid           110
%define confdir         %{_sysconfdir}/%{name}
%define logdir          %{_localstatedir}/log/%{name}
%define homedir         %{_datadir}/%{name}
%define tempdir         %{_localstatedir}/cache/%{name}/temp
%define rundir          %{_localstatedir}/run/%{name}
%define libdir          %{_localstatedir}/lib/%{name}/lib
%define appdir          %{_localstatedir}/lib/%{name}/webapps
%define demodir         %{_localstatedir}/lib/%{name}/demo

Name:           jetty5
Version:        5.1.14
Release:        3.<RELEASE7>
Summary:        Webserver and Servlet Container
Group:          Networking/Daemons
License:        ASL 2.0
Url:            http://jetty.mortbay.org/jetty/
Source0:        http://ftp.mortbay.org/pub/jetty-5/jetty-5.1.14.tar.bz2
Source1:        jetty5.script
Source2:        jetty5.init
Source3:        jetty.logrotate
Source4:        jetty-OSGi-MANIFEST.MF
Source5:        jetty5.pom
Source6:        jettyrc
Source1000:     Changelog.jpackage
Source1001:     jetty5-rpmlintrc
Patch0:         jetty-extra-j2ee-build_xml.patch
Patch1:         jetty-PostFileFilter.patch
Patch2:         jetty-libgcj-bad-serialization.patch
Patch3:         jetty-TestRFC2616-libgcj-bad-date-parser.patch
Patch4:         jetty-CERT438616-CERT237888-CERT21284.patch
# PATCH-OPENSUSE: read jettyrc from /etc/jetty5, allow empty pid file, secure temp file creation
Patch5:         jetty5-jettysh.patch
# PATCH-FIX-UPSTREAM bnc#551802, brc#499867
# https://bugzilla.redhat.com/attachment.cgi?id=343874
Patch6:         jetty-5.1.14-CVE-2009-1523.patch
BuildRequires:  jpackage-utils >= 1.6
# build only
BuildRequires:  ant-junit
BuildRequires:  jakarta-commons-collections
BuildRequires:  junit
BuildRequires:  xdoclet
BuildRequires:  xjavadoc
# main
BuildRequires:  ant >= 1.6
BuildRequires:  jakarta-commons-el
BuildRequires:  jakarta-commons-logging
BuildRequires:  jsse
BuildRequires:  mx4j >= 3.0
BuildRequires:  jsp_2_0_api
BuildRequires:  jasper5
BuildRequires:  servlet_2_4_api
BuildRequires:  xerces-j2 >= 2.7
BuildRequires:  xml-commons-apis
#!BuildIgnore:  gnu-jaf
BuildRequires:  fdupes
# extra
%if %with extra
BuildRequires:  carol
BuildRequires:  geronimo-j2ee-connector-1_5-api
BuildRequires:  geronimo-j2ee-management-1_0-api
BuildRequires:  howl-logger
BuildRequires:  hsqldb
BuildRequires:  jaf
BuildRequires:  jakarta-commons-cli
BuildRequires:  javamail
%if %with bootstrap
BuildRequires:  jboss4-cluster
BuildRequires:  jboss4-common
BuildRequires:  jboss4-j2ee
BuildRequires:  jboss4-jmx
BuildRequires:  jboss4-security
BuildRequires:  jboss4-server
BuildRequires:  jboss4-system
%else
BuildRequires:  jbossas
%endif
BuildRequires:  jgroups
BuildRequires:  jotm
BuildRequires:  geronimo-jta-1_0_1B-api
BuildRequires:  log4j
BuildRequires:  openorb-ots
BuildRequires:  xapool
%endif
#
PreReq:         %fillup_prereq
Requires:       jpackage-utils >= 1.6
Requires:       ant >= 1.6
Requires:       jakarta-commons-el
Requires:       jakarta-commons-logging
Requires:       jasper5
Requires:       jsp_2_0_api
Requires:       jsse
Requires:       mx4j >= 3.0
Requires:       servlet_2_4_api
Requires:       xerces-j2 >= 2.7
Requires:       xml-commons-apis
PreReq:         jpackage-utils
BuildArch:      noarch  
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Jetty is a 100% Java HTTP Server and Servlet Container. 
This means that you do not need to configure and run a 
separate web server (like Apache) in order to use java, 
servlets and JSPs to generate dynamic content. Jetty is 
a fully featured web server for static and dynamic content. 
Unlike separate server/container solutions, this means 
that your web server and web application run in the same 
process, without interconnection overheads and complications. 
Furthermore, as a pure java component, Jetty can be simply 
included in your application for demonstration, distribution 
or deployment. Jetty is available on all Java supported 
platforms.  

%package javadoc
License:        ASL 2.0
Summary:        Javadoc for %{name}
Group:          Development/Documentation

%description javadoc
Jetty is a 100% Java HTTP Server and Servlet Container. 
This means that you do not need to configure and run a 
separate web server (like Apache) in order to use java, 
servlets and JSPs to generate dynamic content. Jetty is 
a fully featured web server for static and dynamic content. 
Unlike separate server/container solutions, this means 
that your web server and web application run in the same 
process, without interconnection overheads and complications. 
Furthermore, as a pure java component, Jetty can be simply 
included in your application for demonstration, distribution 
or deployment. Jetty is available on all Java supported 
platforms.  

%package demo
License:        ASL 2.0
Summary:        Examples for %{name}
Group:          Development/Documentation
Requires:       %{name} = %{version}-%{release}

%description demo
Jetty is a 100% Java HTTP Server and Servlet Container. 
This means that you do not need to configure and run a 
separate web server (like Apache) in order to use java, 
servlets and JSPs to generate dynamic content. Jetty is 
a fully featured web server for static and dynamic content. 
Unlike separate server/container solutions, this means 
that your web server and web application run in the same 
process, without interconnection overheads and complications. 
Furthermore, as a pure java component, Jetty can be simply 
included in your application for demonstration, distribution 
or deployment. Jetty is available on all Java supported 
platforms.  

%if %with extra

%package extra
License:        ASL 2.0
Summary:        Extras for %{name}
Group:          Networking/Daemons
Requires:       %{name} = %{version}
Requires:       carol
Requires:       geronimo-j2ee-connector-1_5-api
Requires:       geronimo-j2ee-management-1_0-api
Requires:       howl-logger
Requires:       hsqldb
#Requires:       jaf
Requires:       jakarta-commons-cli
Requires:       javamail
Requires:       jboss4-cluster
Requires:       jboss4-common
Requires:       jboss4-j2ee
Requires:       jboss4-jmx
Requires:       jboss4-system
Requires:       jboss4-security
Requires:       jboss4-server
Requires:       jgroups
# jonas_timer
# objectweb-datasource
Requires:       jotm
Requires:       geronimo-jta-1_0_1B-api
Requires:       log4j
Requires:       openorb-ots
Requires:       xapool
Requires:       xdoclet
Requires:       xjavadoc

%description extra
The purpose of this project is to enrich Jetty by 
selectively incorporating useful J2EE and non-J2EE 
features. The result is JettyPlus, an environment 
offering additional facilities to core web and servlet 
services, but which does not entail a full-blown 
application server (such as JettyJBoss and JettyJOnAS). 
The feature set currently contains: 
Java Transaction API (JTA) and Resource references, eg DataSources 
Java Naming and Directory Interface API (JNDI) 
Log4J 
Java Authentication and Authorization Service (JAAS) 
Java Mail  
These features have been implemented as a pluggable, 
Service-based architecture. This means that it is 
possible to develop and use alternative services to 
those provided. 
%endif

%package manual
License:        ASL 2.0
Summary:        Documents for %{name}
Group:          Development/Documentation

%description manual
Jetty is a 100% Java HTTP Server and Servlet Container. 
This means that you do not need to configure and run a 
separate web server (like Apache) in order to use java, 
servlets and JSPs to generate dynamic content. Jetty is 
a fully featured web server for static and dynamic content. 
Unlike separate server/container solutions, this means 
that your web server and web application run in the same 
process, without interconnection overheads and complications. 
Furthermore, as a pure java component, Jetty can be simply 
included in your application for demonstration, distribution 
or deployment. Jetty is available on all Java supported 
platforms.  

%prep
%setup -q -n %{jettyname}-%{version}
for f in $(find . -name "*.?ar"); do mv $f $f.no; done
find . -name "*.class" -exec rm {} \;
%setup -q -n %{jettyname}-%{version}
mv demo/webapps/servlets-examples.war \
  demo/webapps/servlets-examples-dontdelete
mv demo/webapps/jsp-examples.war \
  demo/webapps/jsp-examples-dontdelete
for f in $(find . -name "*.?ar"); do rm $f; done
find . -name "*.class" -exec rm {} \;
# .war files needed for tests
mv demo/webapps/servlets-examples-dontdelete \
  demo/webapps/servlets-examples.war
mv demo/webapps/jsp-examples-dontdelete \
  demo/webapps/jsp-examples.war
%if %{bootstrap}
rm src/org/mortbay/util/jmx/MX4JHttpAdaptor.java
%endif
%patch0 -b .sav
%patch1 -b .sav
%patch2 -b .sav
%patch3 -b .sav
%patch4
%patch5 -p1 -b .jettyrc
%patch6 -b .CVE-2009-1523
# Delete this Sun specific file.
rm src/org/mortbay/http/SunJsseListener.java
# Convert line endings...
%{__sed} -i 's/\r//' demo/webapps/jetty/auth/logon.html
%{__sed} -i 's/\r//' demo/webapps/jetty/auth/logon.jsp
%{__sed} -i 's/\r//' demo/webapps/jetty/auth/logonError.html
# inject OSGi manifests
mkdir -p META-INF
cp -p %{SOURCE4} META-INF/MANIFEST.MF
pushd ext
  ln -s $(build-classpath ant) .
  ln -s $(build-classpath commons-el) .
  ln -s $(build-classpath commons-logging) .
  ln -s $(build-classpath jasper5-compiler) jasper-compiler.jar
  ln -s $(build-classpath jasper5-runtime)  jasper-runtime.jar
  ln -s $(build-classpath mx4j/mx4j) .
  ln -s $(build-classpath mx4j/mx4j-jmx) .
  ln -s $(build-classpath mx4j/mx4j-remote) .
  ln -s $(build-classpath mx4j/mx4j-tools) .
  ln -s $(build-classpath xerces-j2) xercesImpl.jar
  ln -s $(build-classpath xml-commons-apis) xml-apis.jar
popd
%if %with extra
pushd extra/ext
  ln -s $(build-classpath jaf) activation.jar
  ln -s $(build-classpath commons-cli) .
  ln -s $(build-classpath geronimo-j2ee-connector-1.5-api) connector-1_5.jar
  ln -s $(build-classpath hsqldb) .
  ln -s $(build-classpath geronimo-j2ee-management-1.0-api) javax77.jar
  ln -s $(build-classpath geronimo-jta-1.0.1B-api) jta-spec1_0_1.jar
  ln -s $(build-classpath log4j) .
  ln -s $(build-classpath javamail/mailapi) mail.jar
  ln -s $(build-classpath carol/ow_carol) .
  ln -s $(build-classpath howl-logger) .
#  #jonas_timer.jar
  ln -s $(build-classpath jotm/jotm) .
  ln -s $(build-classpath jotm/iiop-stubs) jotm_iiop_stubs.jar
  ln -s $(build-classpath jotm/jrmp-stubs) jotm_jrmp_stubs.jar
  ln -s $(build-classpath openorb-ots) jts1_0.jar
  #objectweb-datasource.jar
  ln -s $(build-classpath xapool) .
popd
%endif
find . -iname '.cvsignore' -print0 | xargs -0 rm -rf
cp %{SOURCE1000} .
%fdupes -s extra/ demo/

%build
export CLASSPATH=$(build-classpath \
xjavadoc \
)
%if %with extra
CLASSPATH=$CLASSPATH:$(build-classpath \
%if %with bootstrap
jboss4/jboss-j2ee \
jboss4/jboss-common \
jboss4/jboss-system \
jboss4/jboss-jmx \
jboss4/jboss \
jboss4/jbosssx \
jboss4/jbossha \
%else
jbossas/jboss-j2ee \
jboss-common/jboss-common \
jbossas/jboss-system \
jbossas/jboss-jmx \
jbossas/jboss \
jbossas/jbosssx \
jbossas/jbossha \
%endif
jgroups \
log4j \
)
%endif
export OPT_JAR_LIST="junit ant/ant-junit"
ant -Dxdoclet.home=%{_javadir}/xdoclet -Dbuild.sysclasspath=first prepare jars webapps javadoc 
%if %with extra
extra \
%endif
%if %with test
test
%endif
%{jar} uf lib/org.mortbay.jetty.jar META-INF/MANIFEST.MF

%install
# dirs
install -dm 755 $RPM_BUILD_ROOT%{_bindir}
install -dm 755 $RPM_BUILD_ROOT%{_initrddir}
install -dm 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
install -dm 755 $RPM_BUILD_ROOT%{confdir}
install -dm 755 $RPM_BUILD_ROOT%{confdir}/extra
install -dm 755 $RPM_BUILD_ROOT%{demodir}
install -dm 755 $RPM_BUILD_ROOT%{homedir}
install -dm 755 $RPM_BUILD_ROOT%{homedir}/bin
install -dm 755 $RPM_BUILD_ROOT%{homedir}/ext
install -dm 755 $RPM_BUILD_ROOT%{homedir}/extra
install -dm 755 $RPM_BUILD_ROOT%{homedir}/extra/ext
install -dm 755 $RPM_BUILD_ROOT%{libdir}
install -dm 755 $RPM_BUILD_ROOT%{libdir}/extra
install -dm 755 $RPM_BUILD_ROOT%{logdir}
install -dm 755 $RPM_BUILD_ROOT%{rundir}
install -dm 755 $RPM_BUILD_ROOT%{tempdir}
install -dm 755 $RPM_BUILD_ROOT%{appdir}
# main pkg
install -pm 755 extra/unix/bin/jetty.sh $RPM_BUILD_ROOT%{_bindir}/d%{name}
install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
install -pm 755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/%{name}
install -pm 644 start.jar $RPM_BUILD_ROOT%{homedir}/bin
install -pm 644 stop.jar $RPM_BUILD_ROOT%{homedir}/bin
cp -pr etc/* $RPM_BUILD_ROOT%{confdir}
install -pm 644 lib/org.mortbay.jetty.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-%{version}.jar
cp %{SOURCE6} $RPM_BUILD_ROOT%{confdir}/jettyrc
install -pm 644 lib/org.mortbay.jmx.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jmx-%{version}.jar
install -pm 644 lib/javax.servlet.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-servlet-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
pushd $RPM_BUILD_ROOT%{libdir}
  ln -sf %{_javadir}/%{name}/%{name}.jar org.mortbay.jetty.jar
  ln -sf %{_javadir}/%{name}/%{name}-jmx.jar org.mortbay.jmx.jar
popd
pushd $RPM_BUILD_ROOT%{homedir}/ext
ln -s $(build-classpath ant)
ln -s $(build-classpath jasper5-compiler)
ln -s $(build-classpath jasper5-runtime)
ln -s $(build-classpath commons-el)
ln -s $(build-classpath commons-logging)
ln -s $(build-classpath mx4j/mx4j-jmx)
ln -s $(build-classpath mx4j/mx4j-tools)
ln -s $(build-classpath servlet_2_4_api)
ln -s $(build-classpath jsp_2_0_api)
ln -s $(build-classpath xerces-j2)
ln -s $(build-classpath xml-commons-apis)
popd
# extra
%if %with extra
cp -pr extra/etc/* $RPM_BUILD_ROOT%{confdir}/extra
rm $RPM_BUILD_ROOT%{confdir}/extra/LICENSE.apache.txt
rm $RPM_BUILD_ROOT%{confdir}/extra/LICENSE.hsqldb.html
rm $RPM_BUILD_ROOT%{confdir}/extra/LICENSE.p6spy.html
install -pm 644 extra/lib/org.jboss.jetty.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jboss-%{version}.jar
install -pm 644 extra/lib/org.mortbay.ftp.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-ftp-%{version}.jar
install -pm 644 extra/lib/org.mortbay.j2ee.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-j2ee-%{version}.jar
install -pm 644 extra/lib/org.mortbay.jaas.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jaas-%{version}.jar
install -pm 644 extra/lib/org.mortbay.jsr77.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jsr77-%{version}.jar
# omit for 1.6
# install -pm 644 extra/lib/org.mortbay.jetty-jdk1.2.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jetty-jdk1.2-%{version}.jar
install -pm 644 extra/lib/org.mortbay.jetty.plus.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-plus-%{version}.jar
# omit for 1.6
# install -pm 644 extra/lib/org.mortbay.jmx-jdk1.2.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jmx-jdk1.2-%{version}.jar
install -pm 644 extra/lib/org.mortbay.loadbalancer.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-loadbalancer-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
pushd $RPM_BUILD_ROOT%{libdir}/extra
  ln -sf %{_javadir}/%{name}/%{name}-jboss.jar org.jboss.jetty.jar
  ln -sf %{_javadir}/%{name}/%{name}-ftp.jar org.mortbay.ftp.jar
  ln -sf %{_javadir}/%{name}/%{name}-j2ee.jar org.mortbay.j2ee.jar
  ln -sf %{_javadir}/%{name}/%{name}-jaas.jar org.mortbay.jaas.jar
  ln -sf %{_javadir}/%{name}/%{name}-jsr77.jar org.mortbay.jsr77.jar
  ln -sf %{_javadir}/%{name}/%{name}-plus.jar org.mortbay.jetty.plus.jar
  ln -sf %{_javadir}/%{name}/%{name}-loadbalancer.jar org.mortbay.loadbalancer.jar
popd
pushd $RPM_BUILD_ROOT%{homedir}/extra/ext
  #jonas_timer.jar
  #objectweb-datasource.jar
ln -s $(build-classpath jaf)
ln -s $(build-classpath carol/carol)
ln -s $(build-classpath commons-cli)
ln -s $(build-classpath hsqldb)
ln -s $(build-classpath jotm/jotm)
ln -s $(build-classpath jotm/iiop-stubs)
ln -s $(build-classpath jotm/jrmp-stubs)
ln -s $(build-classpath jta)
ln -s $(build-classpath openorb-ots)
ln -s $(build-classpath log4j)
ln -s $(build-classpath javamail/mailapi)
ln -s $(build-classpath xapool)
popd
%endif
# demo
cp -pr demo/* $RPM_BUILD_ROOT%{demodir}
# javadoc
cp -pr webapps/* $RPM_BUILD_ROOT%{appdir}
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
pushd $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
%{jar} xf $RPM_BUILD_ROOT%{appdir}/javadoc.war
popd
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# manual
install -dm 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -p {LICENSE.TXT,VERSION.TXT} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
mv $RPM_BUILD_ROOT%{demodir}/webapps/jetty/* \
                $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
rm -rf $RPM_BUILD_ROOT%{appdir}/jetty
pushd $RPM_BUILD_ROOT%{homedir}
   [ -d etc ]    || ln -fs %{confdir}   etc
   [ -d demo ]    || ln -fs %{demodir}   demo
   [ -d logs ]    || ln -fs %{logdir}    logs
   [ -d lib ]     || ln -fs %{libdir}    lib
   [ -d temp ]    || ln -fs %{tempdir}   temp
   [ -d webapps ] || ln -fs %{appdir}    webapps
%if %with extra
   pushd extra
     [ -d etc ]    || ln -fs %{confdir}/extra  etc
     [ -d lib ]    || ln -fs %{libdir}/extra    lib
   popd
%endif
popd
# no need to fix paths
#perl -pi -e 's#etc/#conf/#g;' $RPM_BUILD_ROOT%{confdir}/*.xml
(cd %{buildroot} && ln -s %{_javadocdir}/%{name} ./%{homedir}/javadoc)
(cd %{buildroot} && ln -s %{_docdir}/%{name}-%{version} ./%{demodir}/webapps/jetty)
# poms
%add_to_maven_depmap jetty5 org.mortbay.jetty %{version} JPP/jetty5 jetty5
mkdir -p $RPM_BUILD_ROOT%{_datadir}/maven2/poms
cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.jetty5.jetty5.pom
%fdupes -s %{buildroot}/
install -d -m 755 $RPM_BUILD_ROOT/%{_sbindir}
ln -sf %{_sysconfdir}/init.d/%{name} $RPM_BUILD_ROOT/%{_sbindir}/rc%{name}

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# Add the "jetty5" user and group
# we need a shell to be able to use su - later
if [ `getent group %{name}` ]; then
    : OK group jetty5 already present
else
    %{_sbindir}/groupadd -r %{name} 2> /dev/null || :
fi
if [ `getent passwd %{name}` ]; then
    : OK user jetty5 already present
else
    %{_sbindir}/useradd -r -g %{name} -c "Jetty5" -s /bin/false \
    -d %{_localstatedir}/lib/%{name} -o %{name} 2> /dev/null || :
fi

%post
%update_maven_depmap
%{fillup_and_insserv %{name}}

%postun
%update_maven_depmap
%restart_on_update %{name}
%insserv_cleanup

%preun
if [ $1 = 0 ]; then
    %stop_on_removal %{name}    
# Don't
#   %{_sbindir}/userdel %{name} >> /dev/null 2>&1 || :
#   %{_sbindir}/groupdel %{name} >> /dev/null 2>&1 || :
    # Remove automated symlinks
    for repository in %{homedir}/ext ; do
        find $repository -name '\[*\]*.jar' ! -type d -exec rm -f {} \;
    done
fi
%if %with extra

%preun extra
  for repository in %{homedir}/extra/ext ; do
      find $repository -name '\[*\]*.jar' ! -type d -exec rm -f {} \;
  done
%endif

%files
%defattr(0644,root,root,0755)
%doc Changelog.jpackage
%attr(0755,root,root) %{_bindir}/*
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/%{name}-%{version}.jar
%{_javadir}/%{name}/%{name}-jmx-%{version}.jar
%{_javadir}/%{name}/%{name}-servlet-%{version}.jar
%{_javadir}/%{name}/%{name}.jar
%{_javadir}/%{name}/%{name}-jmx.jar
%{_javadir}/%{name}/%{name}-servlet.jar
%config(noreplace) %{confdir}
%dir %{libdir}
%{libdir}/org.mortbay.jetty.jar
%{libdir}/org.mortbay.jmx.jar
%dir %{homedir}
%{homedir}/[^e]*
%{homedir}/ext
%{homedir}/etc
%dir %{demodir}
%attr(0755,jetty5,jetty5) %{logdir}
%attr(0755,jetty5,jetty5) %{tempdir}
%attr(0755,jetty5,jetty5) %{rundir}
%dir %{appdir}
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%doc %{_docdir}/%{name}-%{version}/VERSION.TXT
%attr(0755,root,root) %{_initrddir}/%{name}
%{_datadir}/maven2/poms/*
%config %{_mavendepmapfragdir}/*
%dir %{_localstatedir}/cache/%{name}
%dir %{_localstatedir}/lib/%{name}
%{_sbindir}/rc%{name}

%files demo
%defattr(0644,root,root,0755)
%{demodir}/README.txt
%dir %{demodir}/cgi-bin
%attr(0755,root,root) %{demodir}/cgi-bin/*
%{demodir}/docroot
%{demodir}/servlets
%{demodir}/src
%{demodir}/webapps
%dir %{_localstatedir}/lib/%{name}

%files javadoc
%defattr(0644,root,root,0755)
%{appdir}/template
%{appdir}/javadoc.war
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}

%files manual
%defattr(0644,root,root,0755)
%doc %{_docdir}/%{name}-%{version}
%if %with extra

%files extra
%defattr(0644,root,root,0755)
%{_javadir}/%{name}/%{name}-ftp-%{version}.jar
%{_javadir}/%{name}/%{name}-ftp.jar
%{_javadir}/%{name}/%{name}-j2ee-%{version}.jar
%{_javadir}/%{name}/%{name}-j2ee.jar
%{_javadir}/%{name}/%{name}-jaas-%{version}.jar
%{_javadir}/%{name}/%{name}-jaas.jar
%{_javadir}/%{name}/%{name}-jboss-%{version}.jar
%{_javadir}/%{name}/%{name}-jboss.jar
%{_javadir}/%{name}/%{name}-jsr77-%{version}.jar
%{_javadir}/%{name}/%{name}-jsr77.jar
%{_javadir}/%{name}/%{name}-loadbalancer-%{version}.jar
%{_javadir}/%{name}/%{name}-loadbalancer.jar
%{_javadir}/%{name}/%{name}-plus-%{version}.jar
%{_javadir}/%{name}/%{name}-plus.jar
%{confdir}/extra
%{homedir}/extra
%{libdir}/extra
%endif

%changelog
openSUSE Build Service is sponsored by