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