DokuWiki

It's better when it's simple

User Tools

Site Tools


install:opensuse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
install:opensuse [2009-05-02 21:07] – created wernerflammeinstall:opensuse [2015-08-10 13:16] (current) – replaced username with $HOME 2001:4dd0:ff00:9581:552f:20cd:616c:16b3
Line 1: Line 1:
 ====== DokuWiki on openSUSE ====== ====== DokuWiki on openSUSE ======
  
-First, it is quite simple to install DokuWiki on openSUSE (or SLES/SLED). Download the tarball from http://www.splitbrain.org/go/dokuwiki and unpack it into ''/srv/www/htdocs''. Then rename the folder you created by unpacking to ''dokuwiki'' and that's nearly all. When you do it on your own PC, you can invoke it by entering ''http://localhost/dokuwiki/install.php'' (or replace ''localhost'' by the name of the host you installed it on) as URL in your browser. The invoked ''install.php'' will tell you what is wrong, for example the data dir is not writeable by the web server and so on.+First, it is quite simple to install DokuWiki on openSUSE (or SLES/SLED). Download the tarball from http://download.dokuwiki.org and unpack it into ''/srv/www/htdocs''. Then rename the folder you created by unpacking to ''dokuwiki'' and that's nearly all. When you do it on your own PC, you can invoke DokuWiki by entering ''http://localhost/dokuwiki/install.php'' (or replace ''localhost'' by the name of the host you installed it on) as URL in your browser. The invoked ''install.php'' will tell you what is wrong, for example the data dir is not writeable by the web server and so on.
  
 Second, to do all this manually is annoying. So I decided to use openSUSE's build service (see http://en.opensuse.org/Build_Service for details) and put DokuWiki into an rpm package that can be installed on all available openSUSE and SLE versions. When you want to install it from there, you may add ''http://download.opensuse.org/repositories/home:/werfl/<your openSUSE version>'' as installation repository. Unfortunately, it needs apache to run, since this is the only httpd I use myself and where I know how to write the needed config file... Second, to do all this manually is annoying. So I decided to use openSUSE's build service (see http://en.opensuse.org/Build_Service for details) and put DokuWiki into an rpm package that can be installed on all available openSUSE and SLE versions. When you want to install it from there, you may add ''http://download.opensuse.org/repositories/home:/werfl/<your openSUSE version>'' as installation repository. Unfortunately, it needs apache to run, since this is the only httpd I use myself and where I know how to write the needed config file...
Line 7: Line 7:
 ===== What did I do to create this rpm package? ===== ===== What did I do to create this rpm package? =====
  
-First, I had to put the DokuWiki files where they belong according to openSUSE's policy (''/srv/www/dokuwiki''). Then, I had to add an apache configuration file thet declares an alias ''/dokuwiki'' for this place and contains all the lines from the ''.htaccess'' files in the tarball. Downloading, creating the config, repacking for creation of the rpm is all done by a shell script:+First, I had to put the DokuWiki files where they belong according to openSUSE's policy (''/srv/www/dokuwiki''). Then, I had to add an apache configuration file that defines an alias ''/dokuwiki'' for this place and contains all the lines from the ''.htaccess'' files in the tarball. Downloading, creating the config, and repacking for creation of the rpm is all done by a shell script.
  
-<code bash>+On **2012-11-16** I edited the script so that the config files are now in ''/etc/DokuWiki'', and the ''conf'' directory inside the DokuWiki source tree is a symbolic link to the new location. 
 + 
 +On **2015-07-02** I edited the script again so that the scripts now stay with "/usr/bin/php" instead of my modification "/usr/bin/php5". Plus the generated Apache config file contains code for Apache 2.2 and 2.4 now. 
 + 
 +<code bash prepdw.sh>
 #!/bin/bash #!/bin/bash
  
 # an attempt to automatize packaging DokuWiki for openSUSE # an attempt to automatize packaging DokuWiki for openSUSE
  
-RELEASE='2009-02-14' +set -x 
-NEWNAME=$(echo "$RELEASE" | tr '-' '.') + 
-WORKDIR='/home/werner/openSUSE/home:werfl/dw-stable'+RELEASE='2015-08-10     # hey, that's my birthday :)
 NO_OF_COMP=5 NO_OF_COMP=5
-WWWDIR="$WORKDIR/dokuwiki/srv/www"+NEWNAME=$(echo "$RELEASE" | tr '-' '.'
 +WORKDIR="$HOME/openSUSE/home:werfl/dw-temp" 
 +WWWDIR="$WORKDIR/DokuWiki/srv/www
 +NEWCONFDIR='/etc/DokuWiki' 
 +OLDCONFDIR="$WWWDIR/DokuWiki/conf"
  
-mkdir -p "$WORKDIR/dokuwiki/etc/apache2/conf.d"+mkdir -p "$WORKDIR/DokuWiki/etc/apache2/conf.d"
 mkdir -p "$WWWDIR" mkdir -p "$WWWDIR"
  
 # assume the standard download location # assume the standard download location
-DLFROM='http://www.splitbrain.org/_media/projects/dokuwiki' +DLFROM='http://download.dokuwiki.org/src/dokuwiki' 
-DLFILE="dokuwiki-${RELEASE}.tgz"+DLFILE="dokuwiki-stable.tgz"
 # and get the file # and get the file
-wget -O "${WWWDIR}/dokuwiki.tgz" "${DLFROM}/${DLFILE}"+wget -O "${WWWDIR}/DokuWiki.tgz" "${DLFROM}/${DLFILE}"
  
 # unpack it # unpack it
 cd "$WWWDIR" || exit 17 cd "$WWWDIR" || exit 17
-tar -xzf "dokuwiki.tgz" +tar -xzf "DokuWiki.tgz" 
-rm "dokuwiki.tgz"+rm "DokuWiki.tgz"
  
 # move it into the right place, create config dirs # move it into the right place, create config dirs
-mv "dokuwiki-${RELEASE}" dokuwiki +mv "dokuwiki-${RELEASE}" DokuWiki 
-HTACCESSLIST=$(find "${WWWDIR}/dokuwiki" -name '\.htacc*'+HTACCESSLIST=$(find "${WWWDIR}/DokuWiki" -name '\.htacc*'
-cd "$WORKDIR/dokuwiki/etc" || exit 18 +cd "$WORKDIR/DokuWiki/etc" || exit 18 
-ln -s ../srv/www/dokuwiki/conf DokuWiki+mv "$OLDCONFDIR" "$WORKDIR/DokuWiki${NEWCONFDIR}" 
 +cd "$WWWDIR/DokuWiki" 
 +ln -s "../../..${NEWCONFDIR}" "conf" 
 +# remove executable flags 
 +find "$WWWDIR/DokuWiki" -type f -executable | xargs chmod -x 
 +chmod +x $WWWDIR/DokuWiki/bin/*php
  
-# write config for Apache+# write config for Apache 2.2 and 2.4
 # delete .htaccess, move it into Apache's conf # delete .htaccess, move it into Apache's conf
 +cd "$WORKDIR/DokuWiki/etc" || exit 15
 cat > 'apache2/conf.d/DokuWiki.conf' <<EOT cat > 'apache2/conf.d/DokuWiki.conf' <<EOT
-Alias /dokuwiki "/srv/www/dokuwiki"+Alias /dokuwiki "/srv/www/DokuWiki"
  
-<Directory "/srv/www/dokuwiki/">+<Directory "/srv/www/DokuWiki/">
     Options None     Options None
 +    AllowOverride All
     <IfModule mod_dir.c>     <IfModule mod_dir.c>
         DirectoryIndex doku.php index.html index.htm         DirectoryIndex doku.php index.html index.htm
     </IfModule>     </IfModule>
-    AllowOverride All +    <IfModule mod_authz_core.c> 
-    Order allow,deny +      # Apache 2.4 
-    Allow from all+      Require all granted 
 +    </IfModule> 
 +    <IfModule !mod_authz_core.c> 
 +      # Apache 2.2 
 +      Order allow,deny 
 +      Allow from all 
 +    </IfModule>
 </Directory> </Directory>
  
 EOT EOT
 +
 for SUBDIR in $HTACCESSLIST; do for SUBDIR in $HTACCESSLIST; do
- RELDIR=${SUBDIR#${WORKDIR}/dokuwiki+    RELDIR=${SUBDIR#${WORKDIR}/DokuWiki
- RELDIR=${RELDIR%/.htacc*} +    RELDIR=${RELDIR%/.htacc*} 
- echo "<Directory \"$RELDIR\">" >> 'apache2/conf.d/DokuWiki.conf' +    echo "<Directory \"$RELDIR\">" >> "apache2/conf.d/DokuWiki.conf" 
- cat "$SUBDIR" >> 'apache2/conf.d/DokuWiki.conf' +    cat "$SUBDIR"                  >> "apache2/conf.d/DokuWiki.conf" 
- echo "</Directory>" >> 'apache2/conf.d/DokuWiki.conf' +    echo "</Directory>"            >> "apache2/conf.d/DokuWiki.conf" 
- echo " " >> 'apache2/conf.d/DokuWiki.conf' +    echo " "                       >> "apache2/conf.d/DokuWiki.conf" 
- rm "$SUBDIR"+    rm "$SUBDIR"
 done done
-dos2unix -o 'apache2/conf.d/DokuWiki.conf'+dos2unix -o 'apache2/conf.d/DokuWiki.conf.*'
  
 cd "$WORKDIR" || exit 19 cd "$WORKDIR" || exit 19
-tar --strip-components=$NO_OF_COMP -cf "dokuwiki-${NEWNAME}.tar" dokuwiki +tar --strip-components=$NO_OF_COMP -cf "DokuWiki-${NEWNAME}.tar" DokuWiki 
-gzip "dokuwiki-${NEWNAME}.tar"+bzip2 "DokuWiki-${NEWNAME}.tar"
 </code> </code>
  
-Well, that's about all. The resulting file is used by the build process as well as the following ''spec'' file:+Well, that's about all. With a fast internet connection, the script runs in less that a minute for me :-). The resulting file is used by the build process as well as the following ''spec'' file: 
 + 
 +===== The 'spec' file =====
  
-<code rpm>+<code rpmspec dokuwiki.spec>
 # #
 # Spec File for Package DokuWiki # Spec File for Package DokuWiki
 # #
-Summary: DokuWiki, a Wiki written in PHP to work without a database +Summary:        Wiki written in PHP to work without a database 
-Summary(de): DokuWiki, ein in PHP geschriebenes Wiki, das keine Datenbank benutzt +Summary(de):    Ein in PHP geschriebenes Wiki, das keine Datenbank benutzt 
-Name: dokuwiki +Name:           DokuWiki 
-Version: 2009.02.14 +Version:        2015.08.10 
-Release: 1%{?dist} +Release:        1%{?dist} 
-License: GPL v2 +License:        GPL-2.0 
-Group: Productivity/Publishing/Other +Group:          Productivity/Publishing/Other 
-Distribution: openSUSE Linux +Distribution:   openSUSE Linux 
-Vendor: Andreas Gohr <andi@splitbrain.org> +Vendor:         Andreas Gohr <andi@splitbrain.org> 
-URL: http://www.dokuwiki.org/ +URL:            http://www.dokuwiki.org/ 
-Requires: apache2-mod_php5 +Requires:       apache2-mod_php5 
-Requires: php5 +Requires:       php5 >= 5.3 
-PreReq: coreutils +PreReq:         coreutils 
-PreReq: apache2 +PreReq:         apache2 
-BuildArch: noarch +BuildArch:      noarch 
-Prefix: /srv/www +Prefix:         /srv/www 
-Prefix: /etc +Prefix:         /etc 
-Source: %{name}-%{version}.tar.gz +Source:         %{name}-%{version}.tar.bz2 
-Buildroot: %{_tmppath}/%{name}-buildroot +Buildroot:      %{_tmppath}/%{name}-buildroot
-# %packager+
  
 %description %description
Line 132: Line 155:
 %install %install
 install -d $RPM_BUILD_ROOT/etc/apache2/conf.d/ install -d $RPM_BUILD_ROOT/etc/apache2/conf.d/
-install -d $RPM_BUILD_ROOT/srv/www/dokuwiki/+install -d $RPM_BUILD_ROOT/etc/DokuWiki/ 
 +install -d $RPM_BUILD_ROOT/srv/www/DokuWiki/
 cp -a etc/* $RPM_BUILD_ROOT/etc/ cp -a etc/* $RPM_BUILD_ROOT/etc/
 cp -a srv/www/* $RPM_BUILD_ROOT/srv/www/ cp -a srv/www/* $RPM_BUILD_ROOT/srv/www/
Line 141: Line 165:
 %files %files
 %defattr(-, wwwrun, www) %defattr(-, wwwrun, www)
-/srv/www/dokuwiki +/srv/www/DokuWiki 
-%config /etc/apache2/conf.d/DokuWiki.conf+%config /etc/apache2/conf.d/DokuWiki.conf
 %config /etc/DokuWiki %config /etc/DokuWiki
 %attr (644, root, root) /etc/apache2/conf.d/DokuWiki.conf %attr (644, root, root) /etc/apache2/conf.d/DokuWiki.conf
-%attr (754, wwwrun, www) /srv/www/dokuwiki/bin/dwpage.php +%attr (644, wwwrun, www) /etc/DokuWiki/
-%attr (754, wwwrun, www) /srv/www/dokuwiki/bin/indexer.php +%attr (754, wwwrun, www) /srv/www/DokuWiki/bin/dwpage.php 
-%attr (754, wwwrun, www) /srv/www/dokuwiki/bin/wantedpages.php+%attr (754, wwwrun, www) /srv/www/DokuWiki/bin/indexer.php 
 +%attr (754, wwwrun, www) /srv/www/DokuWiki/bin/wantedpages.php 
 +%attr (754, wwwrun, www) /srv/www/DokuWiki/inc/phpseclib/update.sh 
 +%attr (754, wwwrun, www) /srv/www/DokuWiki/lib/scripts/jquery/update.sh
  
 %post %post
-[ -L /etc/DokuWiki ] && rm -rf /etc/DokuWiki 
-[ -L /etc/DokuWiki ] || ln -s /srv/www/dokuwiki/conf /etc/DokuWiki 
  
-%changelog 
-* Sat May 2 2009  Werner Flamme <w.flamme@web.de> 2009.02.14 
-- for details, look at http://www.dokuwiki.org/changes 
-* Mon Dec 15 2008 Werner Flamme <w.flamme@web.de> 2008.05.05 
-- look at http://www.dokuwiki.org/changes 
 </code> </code>
  
-You can use the ''spec'' file and the tarball that is produced by the shell script to build DokuWiki locally. Just save the ''spec'' file as ''/usr/src/packages/SPECS/dokuwiki.spec'', put the tarball into ''/usr/src/packages/SOURCES/'' and start ''rpmbuild -ba /usr/src/packages/SPECS/dokuwiki.spec''. The resulting rpm will appear in ''/usr/src/packages/RPMS/noarch/'' (plus a source rpm in ''/usr/src/packages/SRPMS/'').+You can use the ''spec'' file and the tarball that is produced by the shell script to build DokuWiki locally. Just save the ''spec'' file as ''/usr/src/packages/SPECS/DokuWiki.spec'', put the tarball into ''/usr/src/packages/SOURCES/'' and start ''rpmbuild -ba /usr/src/packages/SPECS/DokuWiki.spec''. The resulting rpm will appear in ''/usr/src/packages/RPMS/noarch/'' (plus a source rpm in ''/usr/src/packages/SRPMS/'').
install/opensuse.1241291226.txt.gz · Last modified: 2009-12-28 11:59 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki