]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - config/phpwiki.spec
Set PhpWiki version to 1.5.4
[SourceForge/phpwiki.git] / config / phpwiki.spec
1 #
2 # RPM spec file for FusionForge
3 #
4 # Initial work by Jesse Becker <jbecker@northwestern.edu>
5 # Reworked for 1.5.x by Alain Peyrat <aljeux@free.fr>
6 #
7 # Copyright (C) 2014 Alain Peyrat
8 #
9
10 # Global Definitions
11 %define WIKI_NAME       PhpWiki
12 %define ADMIN_USER      admin
13 %define ADMIN_PASSWD    myadmin
14
15 %define DB_NAME         phpwiki
16 %define DB_USER         phpwiki
17 %define DB_PASSWD       phpwikipw
18
19 %define httpduser       apache
20 %define httpdgroup      apache
21
22 %define ACCESS_LOG      %{_var}/log/%{name}/%{name}_access.log
23 %define DATABASE_TYPE   SQL
24 %define DATABASE_DSN    mysql://%{admin_user}:%{admin_passwd}
25 %define DEBUG           0
26 %define USER_AUTH_ORDER "PersonalPage"
27 %define LDAP_AUTH_USER  ""
28 %define LDAP_AUTH_PASSWORD      ""
29 %define LDAP_SEARCH_FIELD       ""
30 %define IMAP_AUTH_HOST  ""
31 %define POP3_AUTH_HOST  ""
32 %define AUTH_USER_FILE  ""
33 %define AUTH_SESS_USER  ""
34 %define AUTH_SESS_LEVEL ""
35 %define AUTH_GROUP_FILE ""
36
37 # Disable debug binary detection & generation to speed up process.
38 %global debug_package %{nil}
39
40 # RPM spec preamble
41 Summary: PHP-based Wiki webapplication
42 Name: phpwiki
43 Version: 1.5.4
44 Release: 1
45 BuildArch: noarch
46 License: GPL
47 Group: Applications/Internet
48 Source: http://easynews.dl.sourceforge.net/sourceforge/phpwiki/%{name}-%{version}.tar.gz
49 URL: http://sourceforge.net/projects/phpwiki/
50 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
51 Packager: Alain Peyrat <aljeux@free.fr>
52
53 #Relocation!
54 Prefix: /var/www
55
56 Requires: httpd, php, php-pear, php-mysql
57
58 Autoreq: 0
59
60 %define dest %{buildroot}/%{prefix}/%{name}
61
62 %description
63 PhpWiki is a WikiWikiWeb clone in PHP. A WikiWikiWeb is a site where
64 anyone can edit the pages through an HTML form. Multiple storage
65 backends, dynamic hyperlinking, themeable, scriptable by plugins, full
66 authentication, ACL's.
67
68 %prep
69 %setup
70
71 %install
72 %{__rm} -rf %{buildroot}
73
74 %{__install} -m 755 -d %{buildroot}%{_var}/log/phpwiki
75
76 %{__mkdir} -p %{dest}
77 %{__cp} -r config lib locale pgsrc themes schemas uploads %{dest}
78 %{__cp} favicon.ico *.php wiki %{dest}
79
80 cd %{dest}/config
81 perl -p \
82         -e 's,^(WIKI_NAME)\s*=.*,$1 = %{WIKI_NAME},;'   \
83         -e 's,^[;\s]*(ADMIN_USER)\s*=.*,$1 = %{ADMIN_USER},;'   \
84         -e 's,^[;\s]*(ADMIN_PASSWD)\s*=.*,$1 = %{ADMIN_PASSWD},;'       \
85         -e 's,^[;\s]*(ACCESS_LOG)\s*=.*,$1 = %{ACCESS_LOG},;'   \
86         -e 's,^[;\s]*(DATABASE_TYPE)\s*=.*,$1 = %{DATABASE_TYPE},;'     \
87         -e 's,^[;\s]*(DATABASE_DSN)\s*=.*,$1 = mysql://%{DB_USER}:%{DB_PASSWD}\@localhost/%{DB_NAME},;' \
88         -e 's,^[;\s]*(DEBUG)\s*=.*,$1 = %{DEBUG},;'     \
89         -e 's,^[;\s]*(USER_AUTH_ORDER)\s*=.*,$1 = %{USER_AUTH_ORDER},;' \
90         -e 's,^[;\s]*(USER_AUTH_ORDER)\s*=.*,$1 = %{USER_AUTH_ORDER},;' \
91         -e 's,^[;\s]*(LDAP_AUTH_USER)\s*=.*,$1 = %{LDAP_AUTH_USER},;'   \
92         -e 's,^[;\s]*(LDAP_AUTH_PASSWORD)\s*=.*,$1 = %{LDAP_AUTH_PASSWORD},;'   \
93         -e 's,^[;\s]*(LDAP_SEARCH_FIELD)\s*=.*,$1 = %{LDAP_SEARCH_FIELD},;'     \
94         -e 's,^[;\s]*(IMAP_AUTH_HOST)\s*=.*,$1 = %{IMAP_AUTH_HOST},;'   \
95         -e 's,^[;\s]*(POP3_AUTH_HOST)\s*=.*,$1 = %{POP3_AUTH_HOST},;'   \
96         -e 's,^[;\s]*(AUTH_USER_FILE)\s*=.*,$1 = %{AUTH_USER_FILE},;'   \
97         -e 's,^[;\s]*(AUTH_SESS_USER)\s*=.*,$1 = %{AUTH_SESS_USER},;'   \
98         -e 's,^[;\s]*(AUTH_SESS_LEVEL)\s*=.*,$1 = %{AUTH_SESS_LEVEL},;' \
99         -e 's,^[;\s]*(AUTH_GROUP_FILE)\s*=.*,$1 = %{AUTH_GROUP_FILE},;' \
100         config-dist.ini > config.ini
101
102
103
104 %clean
105 %{__rm} -rf %{buildroot}
106
107 %post
108
109 cd %{prefix}/%{name}
110 mysqladmin create %{DB_NAME}
111
112 echo 'GRANT select, insert, update, delete, lock tables 
113 ON %{DB_NAME}.* 
114 TO %{DB_USER}@localhost 
115 IDENTIFIED BY "%{DB_PASSWD}"' | mysql
116
117 mysqladmin reload
118
119 cat schemas/mysql-initialize.sql | mysql %{DB_NAME}
120
121 %files
122 %defattr(-, root, root)
123 %doc README UPGRADING LICENSE INSTALL doc Makefile
124 %attr(0775, %{httpduser}, %{httpdgroup}) %dir %{_var}/log/%{name}
125 %{prefix}/%{name}
126
127 %changelog
128 * Fri Sep 19 2014 - Alain Peyrat <aljeux@free.fr> - 1.5.0-1
129 - Reworked for 1.5.0
130
131 * Tue May 19 2005 Jesse Becker <jbecker@northwestern.edu>
132 - Initial build