source: ProjectBuilder/projects/fossology/pbconf/trunk/fossology/rpm/fossology.spec@ 688

Last change on this file since 688 was 688, checked in by Bruno Cornec, 15 years ago

Fossology packages are now built correctly for centos 4 and 5. Remains to test them (install deps flawaed atm)

File size: 4.4 KB
RevLine 
[598]1#
2# $Id$
3#
4
5Name: PBREALPKG
6Version: PBVER
7Release: PBTAGPBSUF
8License: PBLIC
9Group: PBGRP
10Url: PBURL
11Source: PBREPO/PBSRC
12#PBPATCHSRC
13BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
[603]14Requires: postgresql php php-pear php-pgsql libxml2 binutils bzip2 cpio mkisofs poppler-utils rpm tar unzip gzip httpd PBDEP
[616]15BuildRequires: postgresql-devel libxml2 gcc make perl PBBUILDDEP
[606]16Summary: FOSSology is a licenses exploration tool
17Summary(fr): FOSSology est un outil d'exploration de licenses
[598]18
[606]19%package devel
20Summary: Devel part of FOSSology (a licenses exploration tool)
21Summary(fr): Partie dedévelopment de FOSSology, outil d'exploration de licenses
22Group: PBGRP
23
[598]24%description
25PBDESC
26
27%description -l fr
[599]28FOSSology est un outil d'exploration de licenses
[598]29
[606]30%description devel
31Devel part.
32PBDESC
33
34%description -l fr devel
35Partie développement de FOSSology, outil d'exploration de licenses
36
[598]37%prep
38%setup -q
39#PBPATCHCMD
40
41%build
[688]42make SYSCONFDIR=%{_sysconfdir}
43#make %{?_smp_mflags} SYSCONFDIR=%{_sysconfdir}
[598]44
45%install
46%{__rm} -rf $RPM_BUILD_ROOT
[610]47make DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_usr} SYSCONFDIR=%{_sysconfdir} LOCALSTATEDIR=%{_var} LIBDIR=%{_libdir} install
[605]48mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d
[606]49cat > $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/PBPROJ.conf << EOF
50Alias /repo/ /usr/share/PBPROJ/www/
51<Directory "/usr/share/PBPROJ/www">
[602]52 AllowOverride None
53 Options FollowSymLinks MultiViews
54 Order allow,deny
55 Allow from all
56 # uncomment to turn on php error reporting
57 #php_flag display_errors on
58 #php_value error_reporting 2039
59</Directory>
60EOF
[598]61
[624]62#rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/default/PBPROJ
[616]63
[598]64%clean
65%{__rm} -rf $RPM_BUILD_ROOT
66
67%files
68%defattr(-,root,root)
69%doc ChangeLog
[603]70%doc COPYING COPYING.LGPL HACKING README INSTALL INSTALL.multi LICENSE
71#AUTHORS NEWS
[616]72%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
73%config(noreplace) %{_sysconfdir}/cron.d/*
74%config(noreplace) %{_sysconfdir}/PBPROJ/*
[606]75%dir %{_sysconfdir}/PBPROJ
[616]76%dir %{_usr}/lib/PBPROJ
[606]77%dir %{_datadir}/PBPROJ
[616]78%{_sysconfdir}/init.d/*
[606]79%{_usr}/lib/PBPROJ/*
80%{_datadir}/PBPROJ/*
[603]81%{_bindir}/*
82%{_mandir}/man1/*
[598]83
[606]84%files devel
85%{_includedir}/*
[610]86%{_libdir}/*.a
[606]87
[602]88%post
89# Adjust the kernel shmmax (described in detail in section 2.1.3)
90echo 512000000 > /proc/sys/kernel/shmmax
91grep -q kernel.shmmax /etc/sysctl.conf
92if [ $? -eq 0 ]; then
93 perl -pi -e "s/kernel.shmmax\s*=.*/kernel.shmmax=512000000/" /etc/sysctl.conf
94else
95 echo "kernel.shmmax=512000000" >> /etc/sysctl.conf
96fi
97# Adjust postgresql config (described in detail in section 2.1.4)
[603]98# 266 > #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
99# 267 > #ident_file = 'ConfigDir/pg_ident.conf' # IDENT configuration file
100# 268 > #external_pid_file = '(none)' # write an extra pid file
101# 269 > listen_addresses = '*'
102# 270 > max_connections = 50
103# 271 > #shared_buffers = 1000 # min 16 or max_connections*2, 8KB each
104# 272 > shared_buffers = 32768
105# 273 > work_mem = 10240
106# 274 > max_fsm_pages = 100000 # min max_fsm_relations*16, 6 bytes each
107# 275 > fsync = off
108# 276 > full_page_writes = off #recover from partial page writes
109# 277 > commit_delay = 1000
110# 278 > effective_cache_size = 25000
111# 279 > log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
112# 280 > #log_line_prefix = '' # Special values:
[602]113
114# Adjust PHP config (described in detail in section 2.1.5)
[610]115grep -qw memory_limit PBPHPINI
116if [ $? -eq 0 ]; then
117 perl -pi -e "s/memory_limit.*=.*/memory_limit = 702M/" PBPHPINI
118else
119 echo "memory_limit = 702M" >> PBPHPINI
120fi
121grep -qw post_max_size PBPHPINI
122if [ $? -eq 0 ]; then
123 perl -pi -e "s/post_max_size.*=.*/post_max_size = 702M/" PBPHPINI
124else
125 echo "post_max_size = 702M" >> PBPHPINI
126fi
127grep -qw upload_max_filesize PBPHPINI
128if [ $? -eq 0 ]; then
129 perl -pi -e "s/upload_max_filesize.*=.*/upload_max_filesize = 702M/" PBPHPINI
130else
131 echo "upload_max_filesize = 702M" >> PBPHPINI
132fi
[602]133
134# Add apache config for fossology (described in detail in section 2.1.6) - done in install
135/etc/init.d/httpd reload
136
137# Run the postinstall script
[606]138/usr/lib/PBPROJ/fo-postinstall
[602]139
140# Test that things are installed correctly
[606]141/usr/lib/PBPROJ/fossology-scheduler -t
[602]142if [ $? -ne 0 ]; then
143 exit -1
144fi
145
[606]146chkconfig --add PBPROJ
147/etc/init.d/PBPROJ start
[602]148
[640]149%preun
150# If FOSSology is running, stop it before removing.
151/etc/init.d/PBPROJ stop
152chkconfig --del PBPROJ 2>&1 > /dev/null
153
[598]154%changelog
155PBLOG
Note: See TracBrowser for help on using the repository browser.