From: <var...@us...> - 2014-09-19 16:57:56
|
Revision: 9102 http://sourceforge.net/p/phpwiki/code/9102 Author: vargenau Date: 2014-09-19 16:57:47 +0000 (Fri, 19 Sep 2014) Log Message: ----------- Initial RPM for phpwiki (RHEL6 with mysql) Modified Paths: -------------- trunk/Makefile trunk/config/config-dist.ini trunk/config/phpwiki.spec Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2014-09-19 16:54:44 UTC (rev 9101) +++ trunk/Makefile 2014-09-19 16:57:47 UTC (rev 9102) @@ -1,151 +1,16 @@ -# gnu make only +VERSION=1.5.0 +RPMBUILD=rpmbuild -# user-definable settings: -# for mysqladmin -DBADMIN_USER=root -DBADMIN_PASS=secret +clean: + rm -fr /tmp/phpwiki-$(VERSION) /tmp/phpwiki-$(VERSION).tar.gz -# etags (GNU Emacs 21.4.x) -ETAGS_21_5=$(shell etags --version|egrep "Ctags 5.[6789]") -ifeq ("$(ETAGS_21_5)", "") - ETAGS_STDIN = /usr/bin/etags - -else - # new etags (GNU Emacs 21.5.x) - ETAGS_STDIN = /usr/bin/etags -L - -endif +/tmp/phpwiki-$(VERSION).tar.gz: + rm -fr /tmp/phpwiki-$(VERSION) + cp -a . /tmp/phpwiki-$(VERSION) + cd /tmp; tar zcf /tmp/phpwiki-$(VERSION).tar.gz phpwiki-$(VERSION) + rm -fr /tmp/phpwiki-$(VERSION) -VERSION=$(shell admin/dump-version.pl) - -ifeq ("$(VERSION)", "") - TARDIST = phpwiki.tar.bz2 -else - TARDIST = phpwiki-$(VERSION).tar.bz2 -endif -DB_SQLITE_DBFILE = /tmp/phpwiki-sqlite.db - -# **************************************************************************** -# get db params from config/config.ini - -#DATABASE_TYPE=SQL -DATABASE_TYPE := $(shell config/make-dbhelper.pl -v=DATABASE_TYPE config/config.ini) -PROCESS_DSN=0 -ifeq (${DATABASE_TYPE},SQL) - PROCESS_DSN=1 -else - ifeq (${DATABASE_TYPE},ADODB) - PROCESS_DSN=1 - endif -endif - -ifeq (${PROCESS_DSN},1) - # get db params from config/config.ini DATABASE_DSN setting (only if SQL or ADODB) - DATABASE_DSN := $(shell config/make-dbhelper.pl -v=DATABASE_DSN config/config.ini) - #DB_DBTYPE=mysql - DB_DBTYPE := $(word 1,${DATABASE_DSN}) - #DB_DB=phpwiki - DB_DB := $(word 2,${DATABASE_DSN}) - #DB_USER=wikiuser - DB_USER := $(word 3,${DATABASE_DSN}) - #DB_PASS= - DB_PASS := $(word 4,${DATABASE_DSN}) - #Todo: read optional DBADMIN_USER and DBADMIN_PASS settings from config.ini - DBADMIN_OPTS=-u$(DBADMIN_USER) -p$(DBADMIN_PASS) -else - DB_DBTYPE=${DATABASE_TYPE} -endif - -# **************************************************************************** -PHP_SRC := $(wildcard *.php ./lib/*.php ./lib/WikiDB/*.php ./lib/plugin/*.php) - -.PHONY: all install locale mysql pqsql sqlite dbtest install-config dist - -all: TAGS - -TAGS: $(PHP_SRC) - if [ -f $@ ]; then /bin/mv -f $@ $@~; fi -# etags $(PHP_SRC) - /usr/bin/find . \( -type d -regex '\(^\./lib/pear\)\|\(^\./lib/WikiDB/adodb\)\|\(^\./lib/nusoap\)\|\(^\./lib/fpdf\)\|\(^\./locale/.*/LC_MESSAGES\)' \) -prune -o -type f -name \*.php | grep .php | $(ETAGS_STDIN) - -TAGS.full: $(PHP_SRC) - if [ -f $@ ]; then /usr/bin/mv -f $@ $@~; fi - /usr/bin/find . -name \*.php -o -name \*.tmpl | $(ETAGS_STDIN) --langmap="HTML:.tmpl" -f $@ -# older etags needed this: -# /usr/bin/find . -type f -name \*.php -o -name \*.tmpl | etags - -o $@ - -locale: - cd locale - make - -install: install-config install-database - -install-config: config/config.ini - -config/config.ini: config/config-dist.ini - cp config/config-dist.ini $@ - echo "You must edit config/config.ini, at least set the ADMIN_PASSWD" - ${EDITOR} $@ - -# helpers for database installation -install-database: ${DB_DBTYPE} - -dba: - -cvs: - -# maybe setup permissions -file: - -dbtest: - echo DATABASE_TYPE=${DATABASE_TYPE} DB_DBTYPE=${DB_DBTYPE} DB_DB=$(DB_DB) DB_USER=${DB_USER} DB_PASS=${DB_PASS} DBADMIN_OPTS=$(DBADMIN_OPTS) - -# initialize the database -# TODO: compare /var/mysql/data/$(DB_DB) timestamp against schemas/mysql.sql -mysql: - mysqladmin $(DB_OPTS) create $(DB_DB) - mysql $(DB_OPTS) -e "GRANT select,insert,update,delete,lock tables ON $(DB_DB).* \ -TO $(DB_USER)@localhost IDENTIFIED BY '$(DB_PASS)';" - mysql $(DB_OPTS) $(DB_DB) < schemas/mysql-initialize.sql - -# initialize the database -pqsql: - su postmaster - createdb $(DB_DB) - ifeq ($(DB_PASS),"") - createuser -D -A -P $(DB_USER) - else - createuser -D -A $(DB_USER) - endif - psql $(DB_DB) -f schemas/psql-initialize.sql - logout - -# initialize the database -sqlite: $(DB_SQLITE_DBFILE) - sqlite $(DB_SQLITE_DBFILE) < schemas/sqlite-initialize.sql - -# update the database -${DB_SQLITE_DBFILE}: schemas/sqlite.sql - echo ".dump" | sqlite ${DB_SQLITE_DBFILE} > dump.sql - mv ${DB_SQLITE_DBFILE} ${DB_SQLITE_DBFILE}.old - sqlite $(DB_SQLITE_DBFILE) < dump.sql - -dist: $(TARDIST) - -cvstar: ../$(TARDIST) - -# --exclude='\.*' -../$(TARDIST) : $(PHP_SRC) - tar cfj $(TARDIST) --exclude=CVS \ - --exclude=config.ini \ - --exclude='*~' \ - --exclude='*.bak' \ - --exclude='*.orig' \ - --exclude='*.rej' \ - --exclude=uploads \ - --exclude=.patches \ - --exclude=TAGS \ - --exclude=TAGS.full \ - --exclude='*.tar.bz2' \ - . - -$(TARDIST) : $(PHP_SRC) - svn list -R | egrep -v "/\$" | tar cfj $(TARDIST) +rpm: /tmp/phpwiki-$(VERSION).tar.gz + mkdir -p ~/rpmbuild/SOURCES/ + cp /tmp/phpwiki-$(VERSION).tar.gz ~/rpmbuild/SOURCES/ + $(RPMBUILD) -bb config/phpwiki.spec Modified: trunk/config/config-dist.ini =================================================================== --- trunk/config/config-dist.ini 2014-09-19 16:54:44 UTC (rev 9101) +++ trunk/config/config-dist.ini 2014-09-19 16:57:47 UTC (rev 9102) @@ -237,7 +237,7 @@ ; You might have to set it to false, if your PHP doesn't support crypt(). ; To use plain text passwords, in particular for the ADMIN_PASSWD, set ; ENCRYPTED_PASSWD to false. -ENCRYPTED_PASSWD = true +ENCRYPTED_PASSWD = false ; Visitor Hostname Lookup ; @@ -918,7 +918,7 @@ ; ; If you set DEFAULT_LANGUAGE to the empty string, the users ; preferred language as determined by the browser setting will be used. -;DEFAULT_LANGUAGE = en +DEFAULT_LANGUAGE = en ; WIKI_PGSRC -- specifies the source for the initial page contents of ; the Wiki. The setting of WIKI_PGSRC only has effect when the wiki is Modified: trunk/config/phpwiki.spec =================================================================== --- trunk/config/phpwiki.spec 2014-09-19 16:54:44 UTC (rev 9101) +++ trunk/config/phpwiki.spec 2014-09-19 16:57:47 UTC (rev 9102) @@ -1,28 +1,25 @@ +# +# RPM spec file for FusionForge +# +# Initial work by Jesse Becker <jb...@no...> +# Reworked for 1.5.x by Alain Peyrat <al...@fr...> +# +# Copyright (C) 2014 Alain Peyrat +# -Summary: PHP-based Wiki webapplication -Name: phpwiki -Version: 1.3.11 -Release: 1 +# Global Definitions +%define WIKI_NAME PhpWiki +%define ADMIN_USER admin +%define ADMIN_PASSWD myadmin +%define DB_NAME phpwiki +%define DB_USER phpwiki +%define DB_PASSWD phpwikipw -############################################# -# User options here -############################################# +%define httpduser apache +%define httpdgroup apache -#These are setup mostly for my local config. -#Edit to taste, add salt, and boil for 3 minutes. - -%define WIKI_NAME NU-Wiki -%define ADMIN_USER <PHPWiki admin account name here> -%define ADMIN_PASSWD <encrypted admin account PW here, see passencrypt.php> - -%define DB_NAME <database name> -%define DB_USER <database user account> -%define DB_PASSWD <database account password> - -%define HTTPD_UID apache - -%define ACCESS_LOG /var/log/httpd/phpwiki_access.log +%define ACCESS_LOG %{_var}/log/%{name}/%{name}_access.log %define DATABASE_TYPE SQL %define DATABASE_DSN mysql://%{admin_user}:%{admin_passwd} %define DEBUG 0 @@ -37,29 +34,27 @@ %define AUTH_SESS_LEVEL "" %define AUTH_GROUP_FILE "" +# Disable debug binary detection & generation to speed up process. +%global debug_package %{nil} - +# RPM spec preamble +Summary: PHP-based Wiki webapplication +Name: phpwiki +Version: 1.5.0 +Release: 1 +BuildArch: noarch +License: GPL Group: Applications/Internet -License: GPL +Source: http://easynews.dl.sourceforge.net/sourceforge/phpwiki/%{name}-%{version}.tar.gz URL: http://sourceforge.net/projects/phpwiki/ - -Packager: Jesse Becker <jb...@no...> -Vendor: Northwestern University - -Source: http://easynews.dl.sourceforge.net/sourceforge/phpwiki/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +Packager: Alain Peyrat <al...@fr...> - #Relocation! Prefix: /var/www -Requires: php php-mysql +Requires: httpd, php, php-pear, php-mysql -# For some systems (like older RH) -Requires: apache -#For newer systems -#Requires: httpd, php-pear - Autoreq: 0 %define dest %{buildroot}/%{prefix}/%{name} @@ -71,13 +66,16 @@ authentication, ACL's. %prep -%setup +%setup %install %{__rm} -rf %{buildroot} + +%{__install} -m 755 -d %{buildroot}%{_var}/log/phpwiki + %{__mkdir} -p %{dest} %{__cp} -r config lib locale pgsrc themes schemas uploads %{dest} -%{__cp} favicon.ico *.php *.wsdl *.wdsl wiki %{dest} +%{__cp} favicon.ico *.php wiki %{dest} cd %{dest}/config perl -p \ @@ -107,11 +105,6 @@ %{__rm} -rf %{buildroot} %post -touch %{ACCESS_LOG} -if [ -f %{ACCESS_LOG} ]; then - chown %{HTTPD_UID} %{ACCESS_LOG} - chmod 644 %{ACCESS_LOG} -fi cd %{prefix}/%{name} mysqladmin create %{DB_NAME} @@ -123,30 +116,17 @@ mysqladmin reload -cat schemas/mysql.sql | mysql %{DB_NAME} +cat schemas/mysql-initialize.sql | mysql %{DB_NAME} - %files -%defattr(-, root, root, 0755) -%doc README UPGRADING LICENSE INSTALL doc Makefile tests +%defattr(-, root, root) +%doc README UPGRADING LICENSE INSTALL doc Makefile +%attr(0775, %{httpduser}, %{httpdgroup}) %dir %{_var}/log/%{name} +%{prefix}/%{name} -%{prefix}/%{name}/*.php -%{prefix}/%{name}/*.wsdl -%{prefix}/%{name}/wiki +%changelog +* Fri Sep 19 2014 - Alain Peyrat <al...@fr...> - 1.5.0-1 +- Reworked for 1.5.0 -%{prefix}/%{name}/lib -%{prefix}/%{name}/locale -%{prefix}/%{name}/pgsrc -%{prefix}/%{name}/themes -%{prefix}/%{name}/schemas -%{prefix}/%{name}/config/config-default.ini -%dir %{prefix}/%{name}/uploads - -%config %{prefix}/%{name}/uploads/.htaccess -%config %{prefix}/%{name}/config/config.ini - - - -%changelog * Tue May 19 2005 Jesse Becker <jb...@no...> - Initial build This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |