2 %include /usr/lib/rpm/macros.java
3 Summary: Maven Repository Manager
8 Group: Networking/Daemons/Java
9 Source0: http://nexus.sonatype.org/downloads/%{name}-webapp-%{version}.war
10 # Source0-md5: bcf59d3a8ab3bd598293473798a89352
11 Source1: %{name}-context.xml
12 Source2: %{name}-plexus.properties
13 URL: http://nexus.sonatype.org/
14 BuildRequires: jpackage-utils
15 BuildRequires: rpm-javaprov
16 BuildRequires: rpmbuild(macros) >= 1.300
17 Requires: group(servlet)
18 Requires: jpackage-utils
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 Nexus is a powerful and robust Maven repository manager, created to
25 provide reliable access to artifacts required for development and
26 provisioning. Maven's central repository has always served as a great
27 convenience for users of Maven, but it has always been recommended to
28 maintain your own repositories to ensure stability within your
29 organization. Nexus greatly simplifies the maintenance of your own
30 internal repositories and access to external repositories. With Nexus
31 you can completely control access to, and deployment of, every
32 artifact in your organization from a single location.
38 rm -rf $RPM_BUILD_ROOT
40 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/nexus,%{_datadir}/nexus,/var/log/nexus,%{_sharedstatedir}/{nexus/conf,tomcat/conf/Catalina/localhost}}
41 install %{SOURCE1} $RPM_BUILD_ROOT%{_sharedstatedir}/tomcat/conf/Catalina/localhost/nexus.xml
42 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/nexus/plexus.properties
44 cp -a . $RPM_BUILD_ROOT%{_datadir}/nexus
46 mv $RPM_BUILD_ROOT%{_datadir}/nexus/WEB-INF/web.xml $RPM_BUILD_ROOT%{_sysconfdir}/nexus/web.xml
47 ln -sf %{_sysconfdir}/nexus/web.xml $RPM_BUILD_ROOT%{_datadir}/nexus/WEB-INF/web.xml
48 ln -sf %{_sysconfdir}/nexus/plexus.properties $RPM_BUILD_ROOT%{_datadir}/nexus/WEB-INF/plexus.properties
50 # These files are configs, but they should be created by nexus. So lets
51 # install them as %%ghost %%config, and link to /etc/nexus
52 touch $RPM_BUILD_ROOT%{_sharedstatedir}/nexus/conf/log4j.properties
53 touch $RPM_BUILD_ROOT%{_sharedstatedir}/nexus/conf/nexus.xml
54 touch $RPM_BUILD_ROOT%{_sharedstatedir}/nexus/conf/security.xml
55 touch $RPM_BUILD_ROOT%{_sharedstatedir}/nexus/conf/lvo-plugin.xml
56 ln -sf %{_sharedstatedir}/nexus/conf/log4j.properties $RPM_BUILD_ROOT%{_sysconfdir}/nexus/log4j.properties
57 ln -sf %{_sharedstatedir}/nexus/conf/nexus.xml $RPM_BUILD_ROOT%{_sysconfdir}/nexus/nexus.xml
58 ln -sf %{_sharedstatedir}/nexus/conf/security.xml $RPM_BUILD_ROOT%{_sysconfdir}/nexus/security.xml
59 ln -sf %{_sharedstatedir}/nexus/conf/lvo-plugin.xml $RPM_BUILD_ROOT%{_sysconfdir}/nexus/lvo-plugin.xml
62 ln -s /var/log/nexus $RPM_BUILD_ROOT%{_sharedstatedir}/nexus/logs
65 rm -rf $RPM_BUILD_ROOT
68 %defattr(644,root,root,755)
70 %attr(770,root,servlet) %{_datadir}/nexus
71 %dir %attr(770,root,servlet) %{_sharedstatedir}/nexus
72 %dir %attr(770,root,servlet) %{_sharedstatedir}/nexus/logs
73 %dir %attr(770,root,servlet) %{_sharedstatedir}/nexus/conf
74 %attr(770,root,servlet) /var/log/nexus
76 %dir %{_sysconfdir}/nexus
77 %attr(644,root,servlet) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nexus/plexus.properties
78 %attr(660,root,servlet) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nexus/web.xml
79 %attr(660,root,servlet) %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/tomcat/conf/Catalina/localhost/nexus.xml
81 # These files are created by nexus, but they are config files.
82 %ghost %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/nexus/conf/log4j.properties
83 %ghost %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/nexus/conf/nexus.xml
84 %ghost %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/nexus/conf/security.xml
85 %ghost %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/nexus/conf/lvo-plugin.xml
86 %{_sysconfdir}/nexus/log4j.properties
87 %{_sysconfdir}/nexus/nexus.xml
88 %{_sysconfdir}/nexus/security.xml
89 %{_sysconfdir}/nexus/lvo-plugin.xml