]> git.pld-linux.org Git - packages/wordpress.git/blobdiff - wordpress.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/wordpress.git] / wordpress.spec
index fa5c1b11e317c4429ef3fadadf09c2ff5805cb7c..1c3d1f307194c7998b2df7a3af4f26540a4d2239 100644 (file)
@@ -1,31 +1,68 @@
 # TODO
-# - put config files to %{_sysconfdir}!
-# - switch to versioned url: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/00README
+# - gettext mo to system dir, add all possible languages?
+# - merge changes from wpmu.spec
+%define                php_min_version 5.2.1
 Summary:       Personal publishing system
 Summary(pl.UTF-8):     Osobisty system publikacji
 Name:          wordpress
-Version:       2.3.1
-Release:       1
-License:       GPL
+Version:       3.5.2
+Release:       3
+License:       GPL v2
 Group:         Applications/Publishing
-Source0:       http://wordpress.org/latest.tar.gz
-# Source0-md5: bd53264cbe80e470c5a9bc2cf7aa85e4
+Source0:       http://wordpress.org/%{name}-%{version}.tar.gz
+# Source0-md5: 90acae65199db7b33084ef36860d7f22
 Source1:       wp-secure.sh
 Source2:       wp-setup.sh
 Source3:       wp-setup.txt
-Source4:       %{name}.conf
-Source5:        %{name}-lighttpd.conf
-URL:           http://wordpress.org/
+Source4:       apache.conf
+Source5:       lighttpd.conf
+# no 3.5.1 tag
+Source6:       http://svn.automattic.com/wordpress-i18n/et/tags/3.5/messages/et.po
+# Source6-md5: e6fbcf1940701ce6f1f91c0ad4ed5a99
+# no messages under 3.5 tag
+Source7:       http://svn.automattic.com/wordpress-i18n/pl_PL/tags/3.2.1/messages/pl_PL.po
+# Source7-md5: a0f5d65b7d4e5d53209edc595a19ff49
+Patch0:                configpath.patch
+Patch1:                multisite.patch
+Patch2:                %{name}.patch
+Patch3:                simplepie.patch
+Patch4:                pear-text-diff.patch
+Patch6:                swfobject.patch
+Patch7:                phpmailer.patch
+URL:           http://www.wordpress.org/
+BuildRequires: gettext-tools
+BuildRequires: rpm-php-pearprov
+BuildRequires: rpmbuild(macros) >= 1.553
+Requires:      js-swfobject >= 2.2
+Requires:      php(core) >= %{php_min_version}
+Requires:      php(date)
+Requires:      php(dom)
 Requires:      php(gettext)
+Requires:      php(hash)
+Requires:      php(iconv)
+Requires:      php(json)
+Requires:      php(mbstring)
 Requires:      php(mysql)
 Requires:      php(pcre)
+Requires:      php(spl)
+Requires:      php(tokenizer)
 Requires:      php(xml)
-Requires:      php(xmlrpc)
+Requires:      php-pear-Text_Diff
+Requires:      php-phpmailer >= 2.0.4
+Requires:      php-simplepie >= 1.2
 Requires:      webapps
-Requires:      webserver(php) >= 5.0
+Requires:      webserver(php)
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+# no pear deps
+%define                _noautopear     pear
+
+%define                _noautophp      php-ftp php-gd php-openssl php-simplexml
+
+# put it together for rpmbuild
+%define                _noautoreq      %{?_noautophp} %{?_noautopear}
+
 %define                _appdir         %{_datadir}/%{name}
 %define                _webapps        /etc/webapps
 %define                _webapp         %{name}
@@ -50,41 +87,174 @@ PHP i MySQL oraz na licencji GPL. Jest oficjalnym następcą b2/cafelog.
 WordPress jest nowym oprogramowaniem, ale jego korzenie i rozwój
 sięgają 2001 roku.
 
+%package setup
+Summary:       WordPress setup package
+Summary(pl.UTF-8):     Pakiet do wstępnej konfiguracji WordPress
+Group:         Applications/WWW
+Requires:      %{name} = %{version}-%{release}
+
+%description setup
+Install this package to configure initial WordPress installation. You
+should uninstall this package when you're done, as it considered
+insecure to keep the setup files in place.
+
+%description setup -l pl.UTF-8
+Ten pakiet należy zainstalować w celu wstępnej konfiguracji WordPress
+po pierwszej instalacji. Potem należy go odinstalować, jako że
+pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
+
+%package plugin-akismet
+Summary:       WordPress Akismet Plugin
+Group:         Applications/WWW
+Requires:      %{name} = %{version}-%{release}
+
+%description plugin-akismet
+Akismet checks your comments against the Akismet web service to see if
+they look like spam or not and lets you review the spam it catches
+under your blog's "Comments" admin screen.
+
+%package theme-twentyeleven
+Summary:       WordPress Twenty Eleven theme
+Group:         Applications/WWW
+URL:           http://wordpress.org/extend/themes/twentyeleven
+Requires:      %{name} = %{version}-%{release}
+
+%description theme-twentyeleven
+The 2011 theme for WordPress is sophisticated, lightweight, and
+adaptable.
+
+Make it yours with a custom menu, header image, and background -- then
+go further with available theme options for light or dark color
+scheme, custom link colors, and three layout choices. Twenty Eleven
+comes equipped with a Showcase page template that transforms your
+front page into a showcase to show off your best content, widget
+support galore (sidebar, three footer areas, and a Showcase page
+widget area), and a custom "Ephemera" widget to display your Aside,
+Link, Quote, or Status posts. Included are styles for print and for
+the admin editor, support for featured images (as custom header images
+on posts and pages and as large images on featured "sticky" posts),
+and special styles for six different post formats.
+
+%package theme-twentytwelve
+Summary:       WordPress Twenty Twelve theme
+Group:         Applications/WWW
+URL:           http://wordpress.org/extend/themes/twentytwelve
+Requires:      %{name} = %{version}-%{release}
+
+%description theme-twentytwelve
+The 2012 theme for WordPress is a fully responsive theme that looks
+great on any device.
+
+Features include a front page template with its own widgets, an
+optional display font, styling for post formats on both index and
+single views, and an optional no-sidebar page template. Make it yours
+with a custom menu, header image, and background.
+
 %prep
-%setup -q -n %{name}
-cp %{SOURCE1} %{SOURCE2} %{SOURCE3} .
-rm -f license.txt
+%setup -qc
+mv %{name}/* . && rmdir %{name}
+%undos -f php,js,html
+%patch0 -p1
+%patch1 -p1
+cp -p wp-config{-sample,}.php
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch6 -p1
+%patch7 -p1
+cp -p %{SOURCE3} .
+
+%{__rm} license.txt
+%{__rm} wp-content/themes/index.php
+%{__rm} wp-content/plugins/index.php
+%{__rm} wp-content/index.php
+
+# remove .js/.css with matching minified file
+find -name '*.min.js' | while read min; do
+       js=${min%.min.js}.js
+       test -e $js && echo $js
+done | xargs rm -v
+
+find -name '*.min.css' | while read min; do
+       css=${min%.min.css}.css
+       test -e $css && echo $css
+done | xargs rm -v
+
+# sample plugin
+%{__rm} wp-content/plugins/hello.php
+
+# system swfobject
+%{__rm} wp-includes/js/swfobject.js
+
+# system simplepie
+%{__rm} wp-includes/class-simplepie.php
+
+# system php-pear-Text_Diff
+%{__rm} -r wp-includes/Text/Diff*
+rmdir wp-includes/Text
+
+# system atomlib
+%{__rm} wp-includes/atomlib.php
+
+# system phpmailer
+%{__rm} wp-includes/class-phpmailer.php
+%{__rm} wp-includes/class-smtp.php
+
+# php 5.2 + json ext satisfies this compat
+%{__rm} wp-includes/class-json.php
+
+%{__rm} wp-content/plugins/akismet/.htaccess
+
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+
+%build
+install -d wp-content/languages
+msgfmt --statistics %{SOURCE6} -o wp-content/languages/et.mo
+msgfmt --statistics %{SOURCE7} -o wp-content/languages/pl_PL.mo
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_sysconfdir}}
+install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_sysconfdir},%{_appdir}/wp-content/{languages,mu-plugins},/var/{lib,log}/%{name}}
 
-cp -R * $RPM_BUILD_ROOT%{_appdir}
+cp -a . $RPM_BUILD_ROOT%{_appdir}
+mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/wp-config.php
 rm -f $RPM_BUILD_ROOT%{_appdir}/readme.html
 rm -f $RPM_BUILD_ROOT%{_appdir}/wp-setup.txt
-ln -sf %{_appdir}/wp-setup.sh $RPM_BUILD_ROOT%{_bindir}/wp-setup
-ln -sf %{_appdir}/wp-secure.sh $RPM_BUILD_ROOT%{_bindir}/wp-secure
 
-install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
-install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
-install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/wp-secure
+install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/wp-setup
+ln -s %{_bindir}/wp-setup $RPM_BUILD_ROOT%{_appdir}/wp-setup.sh
+ln -s %{_bindir}/wp-secure $RPM_BUILD_ROOT%{_appdir}/wp-secure.sh
+
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-if [ ! -f %{_appdir}/wp-config.php ]; then
-       install -uroot -ghttp -m640 %{_appdir}/wp-config-sample.php > %{_appdir}/wp-config.php
-
+if [ "$1" = 1 ]; then
        %banner -e %{name} <<-EOF
        To finish your configuration DO NOT FORGET to:
 
        1) Create some MySQL database owned by some user
-       2) Edit the file: %{_appdir}/wp-config.php
-       3) Run a browser and visit: http://`hostname`/wordpress/wp-admin/install.php
+       2) Edit the file: %{_sysconfdir}/wp-config.php
+       3) Install %{name}-setup
+       4) Run a browser and visit: http://`hostname`/wordpress/wp-admin/install.php
 EOF
 fi
 
+%post setup
+chmod 660 %{_sysconfdir}/wp-config.php
+chown root:http %{_sysconfdir}/wp-config.php
+
+%postun setup
+if [ "$1" = "0" ]; then
+       chmod 640 %{_sysconfdir}/wp-config.php
+       chown root:http %{_sysconfdir}/wp-config.php
+fi
+
 %triggerin -- apache1 < 1.3.37-3, apache1-base
 %webapp_register apache %{_webapp}
 
@@ -110,27 +280,45 @@ fi
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/wp-config.php
 
 %dir %{_appdir}
-%dir %attr(750,root,http) %{_appdir}/wp-content
-%dir %attr(750,root,http) %{_appdir}/wp-content/plugins
-%dir %attr(750,root,http) %{_appdir}/wp-content/themes
-%dir %attr(750,root,http) %{_appdir}/wp-content/themes/classic
-%dir %attr(750,root,http) %{_appdir}/wp-content/themes/default
-%dir %attr(750,root,http) %{_appdir}/wp-content/themes/default/images
-%attr(640,root,http) %{_appdir}/wp-content/plugins/*.php
-%attr(640,root,http) %{_appdir}/wp-content/plugins/akismet
-%attr(640,root,http) %{_appdir}/wp-content/themes/classic/*
-%attr(640,root,http) %{_appdir}/wp-content/themes/default/*.php
-%attr(640,root,http) %{_appdir}/wp-content/themes/default/*.css
-%attr(640,root,http) %{_appdir}/wp-content/themes/default/images/*
-%{_appdir}/wp-content/index.php
-%{_appdir}/wp-content/themes/default/screenshot.png
-%{_appdir}/wp-admin
-%{_appdir}/wp-includes
 %{_appdir}/*.php
-%{_appdir}/wp-secure.sh
-%{_appdir}/wp-setup.sh
+%{_appdir}/wp-includes
+%dir %{_appdir}/wp-content
+%dir %{_appdir}/wp-content/languages
+%lang(et) %{_appdir}/wp-content/languages/et.mo
+%lang(pl) %{_appdir}/wp-content/languages/pl_PL.mo
+%dir %{_appdir}/wp-content/plugins
+%dir %{_appdir}/wp-content/mu-plugins
+%dir %{_appdir}/wp-content/themes
+
+# needed for daily moderation
+%{_appdir}/wp-admin
+
+%attr(775,root,http) /var/lib/%{name}
+%attr(775,root,http) /var/log/%{name}
+
+%files setup
+%defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/wp-secure
 %attr(755,root,root) %{_bindir}/wp-setup
-      
+%{_appdir}/wp-secure.sh
+%{_appdir}/wp-setup.sh
+
+%files plugin-akismet
+%defattr(644,root,root,755)
+%dir %{_appdir}/wp-content/plugins/akismet
+%doc %{_appdir}/wp-content/plugins/akismet/readme.txt
+%{_appdir}/wp-content/plugins/akismet/*.css
+%{_appdir}/wp-content/plugins/akismet/*.gif
+%{_appdir}/wp-content/plugins/akismet/*.js
+%{_appdir}/wp-content/plugins/akismet/*.php
+
+%files theme-twentyeleven
+%defattr(644,root,root,755)
+%{_appdir}/wp-content/themes/twentyeleven
+
+%files theme-twentytwelve
+%defattr(644,root,root,755)
+%{_appdir}/wp-content/themes/twentytwelve
This page took 0.090069 seconds and 4 git commands to generate.