source: projects/fossology/pbconf/trunk/fossology/rpm/fossology.spec @ 616

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