| 1 | # |
|---|
| 2 | # $Id$ |
|---|
| 3 | # |
|---|
| 4 | # Used if virtual name != real name (perl, ...) |
|---|
| 5 | #%define srcname PBPKG |
|---|
| 6 | |
|---|
| 7 | Name: PBREALPKG |
|---|
| 8 | Version: PBVER |
|---|
| 9 | Release: PBTAGPBSUF |
|---|
| 10 | License: PBLIC |
|---|
| 11 | Group: PBGRP |
|---|
| 12 | Url: PBURL |
|---|
| 13 | Source: PBREPO/PBSRC |
|---|
| 14 | #PBPATCHSRC |
|---|
| 15 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) |
|---|
| 16 | Requires: postgresql php php-pear php-pgsql libxml2 binutils bzip2 cpio mkisofs poppler-utils rpm tar unzip gzip httpd PBDEP |
|---|
| 17 | BuildRequires: postgresql-devel libxml2 gcc make perl libmagic-devel PBBUILDDEP |
|---|
| 18 | Summary: FOSSology is a licenses exploration tool |
|---|
| 19 | Summary(fr): FOSSology est un outil d'exploration de licenses |
|---|
| 20 | |
|---|
| 21 | %package devel |
|---|
| 22 | Summary: Devel part of FOSSology (a licenses exploration tool) |
|---|
| 23 | Summary(fr): Partie dedévelopment de FOSSology, outil d'exploration de licenses |
|---|
| 24 | Group: PBGRP |
|---|
| 25 | |
|---|
| 26 | %description |
|---|
| 27 | PBDESC |
|---|
| 28 | |
|---|
| 29 | %description -l fr |
|---|
| 30 | FOSSology est un outil d'exploration de licenses |
|---|
| 31 | |
|---|
| 32 | %description devel |
|---|
| 33 | Devel part. |
|---|
| 34 | PBDESC |
|---|
| 35 | |
|---|
| 36 | %description -l fr devel |
|---|
| 37 | Partie développement de FOSSology, outil d'exploration de licenses |
|---|
| 38 | |
|---|
| 39 | %prep |
|---|
| 40 | %setup -q |
|---|
| 41 | #PBPATCHCMD |
|---|
| 42 | |
|---|
| 43 | %build |
|---|
| 44 | make %{?_smp_mflags} SYSCONFDIR=%{_sysconfdir} |
|---|
| 45 | |
|---|
| 46 | %install |
|---|
| 47 | %{__rm} -rf $RPM_BUILD_ROOT |
|---|
| 48 | make DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_usr} SYSCONFDIR=%{_sysconfdir} LOCALSTATEDIR=%{_var} install |
|---|
| 49 | mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d |
|---|
| 50 | cat > $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/PBPROJ.conf << EOF |
|---|
| 51 | Alias /repo/ /usr/share/PBPROJ/www/ |
|---|
| 52 | <Directory "/usr/share/PBPROJ/www"> |
|---|
| 53 | AllowOverride None |
|---|
| 54 | Options FollowSymLinks MultiViews |
|---|
| 55 | Order allow,deny |
|---|
| 56 | Allow from all |
|---|
| 57 | # uncomment to turn on php error reporting |
|---|
| 58 | #php_flag display_errors on |
|---|
| 59 | #php_value error_reporting 2039 |
|---|
| 60 | </Directory> |
|---|
| 61 | EOF |
|---|
| 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 | %dir %{_datadir}/* |
|---|
| 72 | %dir %{_localstatedir}/PBPROJ |
|---|
| 73 | %dir %{_usr}/lib/PBPROJ |
|---|
| 74 | %dir %{_sysconfdir}/PBPROJ |
|---|
| 75 | %dir %{_datadir}/PBPROJ |
|---|
| 76 | %{_sysconfdir}/PBPROJ/* |
|---|
| 77 | %{_usr}/lib/PBPROJ/* |
|---|
| 78 | %{_localstatedir}/PBPROJ/* |
|---|
| 79 | %{_datadir}/PBPROJ/* |
|---|
| 80 | %{_sysconfdir}/httpd/conf.d/*.conf |
|---|
| 81 | %{_sysconfdir}/cron.d/* |
|---|
| 82 | %{_sysconfdir}/init.d/* |
|---|
| 83 | %{_bindir}/* |
|---|
| 84 | %{_mandir}/man1/* |
|---|
| 85 | |
|---|
| 86 | %files devel |
|---|
| 87 | %{_includedir}/* |
|---|
| 88 | %{_libexecdir}/*.a |
|---|
| 89 | |
|---|
| 90 | %post |
|---|
| 91 | # Adjust the kernel shmmax (described in detail in section 2.1.3) |
|---|
| 92 | echo 512000000 > /proc/sys/kernel/shmmax |
|---|
| 93 | grep -q kernel.shmmax /etc/sysctl.conf |
|---|
| 94 | if [ $? -eq 0 ]; then |
|---|
| 95 | perl -pi -e "s/kernel.shmmax\s*=.*/kernel.shmmax=512000000/" /etc/sysctl.conf |
|---|
| 96 | else |
|---|
| 97 | echo "kernel.shmmax=512000000" >> /etc/sysctl.conf |
|---|
| 98 | fi |
|---|
| 99 | # Adjust postgresql config (described in detail in section 2.1.4) |
|---|
| 100 | # 266 > #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file |
|---|
| 101 | # 267 > #ident_file = 'ConfigDir/pg_ident.conf' # IDENT configuration file |
|---|
| 102 | # 268 > #external_pid_file = '(none)' # write an extra pid file |
|---|
| 103 | # 269 > listen_addresses = '*' |
|---|
| 104 | # 270 > max_connections = 50 |
|---|
| 105 | # 271 > #shared_buffers = 1000 # min 16 or max_connections*2, 8KB each |
|---|
| 106 | # 272 > shared_buffers = 32768 |
|---|
| 107 | # 273 > work_mem = 10240 |
|---|
| 108 | # 274 > max_fsm_pages = 100000 # min max_fsm_relations*16, 6 bytes each |
|---|
| 109 | # 275 > fsync = off |
|---|
| 110 | # 276 > full_page_writes = off #recover from partial page writes |
|---|
| 111 | # 277 > commit_delay = 1000 |
|---|
| 112 | # 278 > effective_cache_size = 25000 |
|---|
| 113 | # 279 > log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements |
|---|
| 114 | # 280 > #log_line_prefix = '' # Special values: |
|---|
| 115 | |
|---|
| 116 | # Adjust PHP config (described in detail in section 2.1.5) |
|---|
| 117 | # /etc/php5/php.ini |
|---|
| 118 | # 291 max_execution_time = 90 |
|---|
| 119 | # 292 memory_limit = 128M |
|---|
| 120 | # 293 error_reporting = E_ALL & E_STRICT |
|---|
| 121 | # 294 display_startup_errors = On |
|---|
| 122 | # 295 log_errors = On |
|---|
| 123 | # 296 log_errors_max_len = 0 |
|---|
| 124 | # 297 error_log = /var/log/php5.log |
|---|
| 125 | # 298 post_max_size = 700M |
|---|
| 126 | # 299 upload_max_filesize = 701M |
|---|
| 127 | # 300 In the "[soap]" section add |
|---|
| 128 | # 301 extension=pgsql.so |
|---|
| 129 | # 303 You should also edit /etc/php5/cli/php.ini to include the fossology directory |
|---|
| 130 | # 304 in the php command line interface path: |
|---|
| 131 | # 305 include_path = ".:/usr/local/share/fossology/php:/usr/local/share/fossology/www" |
|---|
| 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 |
|---|
| 141 | if [ $? -ne 0 ]; then |
|---|
| 142 | exit -1 |
|---|
| 143 | fi |
|---|
| 144 | |
|---|
| 145 | chkconfig --add PBPROJ |
|---|
| 146 | /etc/init.d/PBPROJ start |
|---|
| 147 | |
|---|
| 148 | %changelog |
|---|
| 149 | PBLOG |
|---|
| 150 | |
|---|