Guest User

Untitled

a guest
Jul 18th, 2017
608
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Fedora spec file for wordpress
  2. #
  3. # License: MIT
  4. # http://opensource.org/licenses/MIT
  5. #
  6. # Please preserve changelog entries
  7. #
  8. %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
  9. %global wp_content %{_datadir}/wordpress/wp-content
  10.  
  11. %if 0%{?fedora} >= 21
  12. %global with_nginx 1
  13. %else
  14. %global with_nginx 0
  15. %endif
  16.  
  17. #global prever RC1
  18.  
  19. Summary:    Blog tool and publishing platform
  20. URL:        http://www.wordpress.org
  21. Name:       wordpress
  22. Version:    4.8
  23. Group:      Applications/Publishing
  24. Release:    1%{?dist}
  25. License:    GPLv2
  26.  
  27. Source0:    http://wordpress.org/%{name}-%{version}%{?prever:-%{prever}}.tar.gz
  28. Source1:    wordpress-httpd-conf
  29. Source2:    README.fedora.wordpress
  30. Source3:    README.fedora.wordpress-mu
  31. Source4:    wordpress-nginx-conf
  32.  
  33. # Patch out copyrighted text of Hello, Dolly
  34. # (and replace it with Free Software Song)
  35. Patch0: wordpress-debian_patches_hello.patch
  36. # Move wp-content to /var/www/wordpress/
  37. # This patch doesn’t work well, see bugzilla.redhat.com/522897
  38. Patch1: wordpress-move-wp-content.patch
  39. # Drop swfupload: not built from source, not reasonably possible to do
  40. Patch2: wordpress-4.4-no_swfupload.patch
  41. # Adjust tinymce's media plugin not to use its SWF plugin. This changes
  42. # 'p.getParam("flash_video_player_url",u.convertUrl(u.url+"/moxieplayer.swf"))'
  43. # to 'false'
  44. Patch3: wordpress-4.8-tinymce_noflash.patch
  45. # RPM configuration:
  46. # Path to installation
  47. # Disable auto-updater
  48. Patch5: wordpress-4.0-config.patch
  49. # RPM are readonly
  50. # disable version check and updated
  51. # change DISALLOW_FILE_MODS default value to true
  52. # ignore WP_AUTO_UPDATE_CORE (always false)
  53. Patch6: wordpress-4.8-noupdate.patch
  54. # Use system libraries
  55. Patch7: wordpress-4.4-systemlibs.patch
  56.  
  57. BuildArch: noarch
  58.  
  59. %if %{with_nginx}
  60. Requires: webserver
  61. Requires: php(httpd)
  62. Suggests: httpd
  63. # For directory ownership
  64. Requires: httpd-filesystem
  65. Requires: nginx-filesystem
  66.  
  67. %else
  68. Requires: php >= 5.2.4
  69. %endif
  70. Requires: php-simplepie >= 1.3.1
  71. Requires: php-getid3
  72. Requires: php-ctype
  73. Requires: php-filter
  74. Requires: php-mysqli
  75.  
  76. # From phpcompatinfo report for version 4.5.3
  77. Requires: php-curl
  78. Requires: php-date
  79. Requires: php-dom
  80. Requires: php-exif
  81. Requires: php-fileinfo
  82. Requires: php-ftp
  83. Requires: php-gd
  84. Requires: php-gettext
  85. Requires: php-hash
  86. Requires: php-iconv
  87. Requires: php-json
  88. Requires: php-libxml
  89. Requires: php-mbstring
  90. Requires: php-openssl
  91. Requires: php-pcre
  92. Requires: php-posix
  93. Requires: php-simplexml
  94. Requires: php-sockets
  95. Requires: php-spl
  96. Requires: php-tokenizer
  97. Requires: php-xml
  98. Requires: php-zip
  99. Requires: php-zlib
  100. # Unbundled libraries
  101. Requires: php-PHPMailer
  102. Requires: httpd
  103. # ca-certificates (excepted on EL-5)
  104. Requires: %{_sysconfdir}/pki/tls/certs/ca-bundle.crt
  105. Provides: wordpress-mu = %{version}-%{release}
  106. Obsoletes: wordpress-mu < 2.9.3
  107.  
  108. %description
  109. Wordpress is an online publishing / weblog package that makes it very easy,
  110. almost trivial, to get information out to people on the web.
  111.  
  112. Important information in %{_pkgdocdir}/README.fedora
  113.  
  114.  
  115. %prep
  116. %setup -q -n wordpress
  117.  
  118. # Drop pre-compiled binary lumps: Flash and Silverlight
  119. # This means that Flash video fallbacks in Wordpress' media support
  120. # and the tinymce plugin, the plupload Flash and Silverlight
  121. # uploaders, and swfupload are not available.
  122. # To re-introduce these they would have to be built from the
  123. # ActionScript source as part of this package build, they cannot be
  124. # shipped pre-compiled. Removing plupload.flash.js and
  125. # plupload.silverlight.js causes plupload only to try and use the html4
  126. # or html5 uploaders; if you just wipe the binaries but leave the
  127. # .js files, it will try and use the Flash or Silverlight uploaders
  128. # and draw a non-functional button. - AdamW, 2013/08
  129. # https://fedoraproject.org/wiki/Packaging:Guidelines#No_inclusion_of_pre-built_binaries_or_libraries
  130.  
  131. rm wp-includes/js/mediaelement/silverlightmediaelement.xap
  132. rm wp-includes/js/mediaelement/flashmediaelement.swf
  133. rm wp-includes/js/plupload/plupload.silverlight.xap
  134. rm wp-includes/js/plupload/plupload.flash.swf
  135.  
  136. # swfupload can just die in its entirety
  137. rm -rf wp-includes/js/swfupload
  138.  
  139. # remove .htaccess, protected by httpd config file
  140. rm wp-content/plugins/akismet/.htaccess
  141.  
  142. %patch0 -p1 -b .dolly
  143. #patch1 -p1 -b .rhbz522897
  144. %patch2 -p1
  145. %patch3 -p1
  146. # Adjust mediaelement not to use its SWF and Silverlight plugins. This
  147. # changes 'plugins:["flash,"silverlight","youtube","vimeo"]' to
  148. # 'plugins:["youtube","vimeo"]'
  149. sed -s 's/"flash","silverlight",//' -i wp-includes/js/mediaelement/mediaelement-and-player.min.js
  150. %patch7 -p1
  151.  
  152. # We patch a .js file, used patched file instead of unpatch minified one
  153. ln -sf plugin.js wp-includes/js/tinymce/plugins/media/plugin.min.js
  154.  
  155. # Re-Generated the archive
  156. arc=wp-includes/js/tinymce/wp-tinymce.js
  157. gunzip -dc $arc.gz | \
  158.   grep "^// Source" | \
  159.   while read a b c
  160. do
  161.   if [ -f $c ]; then
  162.     echo -e "\n$a $b $c"
  163.     cat $c
  164.   else
  165.     exit 1
  166.   fi
  167. done >$arc
  168. gzip --force $arc
  169. ls -l $arc.gz
  170.  
  171. # Create RPM configuration
  172. sed -e 's/\r//' wp-config-sample.php >wp-config.php
  173. %patch5 -p1
  174. %patch6 -p1
  175.  
  176. # fix file encoding
  177. sed -i -e 's/\r//' license.txt
  178.  
  179.  
  180. %build
  181.  
  182. %install
  183. # Apache configuration
  184. install -m 0644 -D -p %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/wordpress.conf
  185.  
  186. %if %{with_nginx}
  187. install -m 0644 -D -p %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/nginx/default.d/wordpress.conf
  188. %endif
  189.  
  190. # Application
  191. mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/wordpress
  192. cp -pr * ${RPM_BUILD_ROOT}%{_datadir}/wordpress
  193.  
  194. # Configuration
  195. install -m 0644 -D wp-config.php ${RPM_BUILD_ROOT}%{_sysconfdir}/wordpress/wp-config.php
  196. /bin/ln -sf ../../../etc/wordpress/wp-config.php ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-config.php
  197.  
  198. /bin/cp %{SOURCE2} ./README.fedora
  199. /bin/cp %{SOURCE3} ./README.fedora-multiuser
  200.  
  201. # Create additional wp-content directories so we can own them
  202. install -d ${RPM_BUILD_ROOT}%{wp_content}/{plugins,themes,upgrade,uploads}
  203.  
  204. # Remove empty files to make rpmlint happy
  205. find ${RPM_BUILD_ROOT} -type f -empty -exec rm -vf {} \;
  206. # These are docs, remove them from here, docify them later
  207. rm -f ${RPM_BUILD_ROOT}%{_datadir}/wordpress/{license.txt,readme.html}
  208.  
  209. # Remove bundled php-simplepie and link to system copy
  210. rm    ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-simplepie.php
  211. rm -r ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/SimplePie
  212. ln -s /usr/share/php/php-simplepie/autoloader.php \
  213.        ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-simplepie.php
  214.  
  215. # Remove bundled PHPMailer and link to system one
  216. # Note POP3 is not from PHPMailer but from SquirrelMail
  217. for fic in phpmailer smtp; do
  218.   rm     ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-$fic.php
  219.   ln -sf /usr/share/php/PHPMailer/class.$fic.php \
  220.          ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-$fic.php
  221. done
  222.  
  223. # Remove bundled php-getid3
  224. rm -r ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/ID3
  225.  
  226. # Remove bundled ca-bundle.crt
  227. rm ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/certificates/ca-bundle.crt
  228. ln -s %{_sysconfdir}/pki/tls/certs/ca-bundle.crt \
  229.    ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/certificates/ca-bundle.crt
  230.  
  231. # Remove backup copies of patches
  232. find ${RPM_BUILD_ROOT} \( -name \*.dolly -o -name \*.rhbz522897 -o -name \*.orig \) \
  233.     -print -delete
  234.  
  235. ## Move wp-content directory to /var/www location
  236. #mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/www/wordpress
  237. #mv -v ${RPM_BUILD_ROOT}%{wp_content}/ \
  238. #  ${RPM_BUILD_ROOT}%{_localstatedir}/www/wordpress
  239.  
  240. #%post
  241. #if [ $1 -eq 2 ] ; then
  242. ## In case user has old wp-content from previous version, move it to
  243. ## the new location.
  244. #mv -uf %{wp_content}/* %{_localstatedir}/www/wordpress/
  245. #/sbin/restorecon -R %{_localstatedir}/www/wordpress/
  246. #fi
  247.  
  248.  
  249. %files
  250. %config(noreplace) %{_sysconfdir}/httpd/conf.d/wordpress.conf
  251. %if %{with_nginx}
  252. %config(noreplace) %{_sysconfdir}/nginx/default.d/wordpress.conf
  253. %endif
  254. %dir %{_datadir}/wordpress
  255. %{_datadir}/wordpress/wp-admin
  256. %{_datadir}/wordpress/wp-includes
  257. %{_datadir}/wordpress/index.php
  258. %dir %{wp_content}/
  259. %{wp_content}/index.php
  260. %dir %attr(2775,apache,ftp) %{wp_content}/plugins
  261. %dir %attr(2775,apache,ftp) %{wp_content}/themes
  262. %dir %attr(2775,apache,ftp) %{wp_content}/upgrade
  263. %dir %attr(2775,apache,ftp) %{wp_content}/uploads
  264. %{wp_content}/plugins/*
  265. %{wp_content}/themes/*
  266. %{!?_licensedir:%global license %%doc}
  267. %license license.txt
  268. %doc readme.html
  269. %doc README.fedora
  270. %doc README.fedora-multiuser
  271. %{_datadir}/wordpress/wp-*.php
  272. %attr(750,root,apache) %dir               %{_sysconfdir}/wordpress
  273. %attr(640,root,apache) %config(noreplace) %{_sysconfdir}/wordpress/wp-config.php
  274. %{_datadir}/wordpress/xmlrpc.php
  275.  
  276.  
  277. %changelog
  278. * Fri Jun  9 2017 Remi Collet <remi@remirepo.net> - 4.8-1
  279. - WordPress 4.8 “Evans”
  280.  
  281. * Wed May 17 2017 Remi Collet <remi@remirepo.net> - 4.7.5-1
  282. - WordPress 4.7.5 Security and Maintenance Release
  283.  
  284. * Sat Apr 22 2017 Kevin Fenzi <kevin@scrye.com> - 4.7.4-1
  285. - Update to 4.7.4. Maintenance Release.
  286.  
  287. * Tue Mar  7 2017 Remi Collet <remi@fedoraproject.org> - 4.7.3-1
  288. - WordPress 4.7.3 Security and Maintenance Release
  289.  
  290. * Fri Jan 27 2017 Remi Collet <remi@fedoraproject.org> - 4.7.2-1
  291. - WordPress 4.7.2 Security Release
  292.  
  293. * Thu Jan 12 2017 Remi Collet <remi@fedoraproject.org> - 4.7.1-1
  294. - WordPress 4.7.1 Security and Maintenance Release
  295.  
  296. * Wed Dec  7 2016 Remi Collet <remi@fedoraproject.org> - 4.7.0-1
  297. - WordPress 4.7 “Vaughan”
  298.  
  299. * Thu Sep  8 2016 Remi Collet <remi@fedoraproject.org> - 4.6.1-1
  300. - WordPress 4.6.1 Security and Maintenance Release
  301.  
  302. * Sat Sep  3 2016 Remi Collet <remi@fedoraproject.org> - 4.6-2
  303. - WordPress 4.6 “Pepper”
  304. - fix directory permissions #1305687
  305.  
  306. * Wed Jun 22 2016 Remi Collet <remi@fedoraproject.org> - 4.5.3-1
  307. - WordPress 4.5.3 Maintenance and Security Release
  308. - never bundle ca-bundle.crt (EL-5)
  309. - provide nginx configuration (fedora)
  310. - drop mandatory dependency on httpd (suggested) #1336091
  311. - protect php files in uploads directory
  312.  
  313. * Tue May 10 2016 Remi Collet <remi@fedoraproject.org> - 4.5.2-1
  314. - WordPress 4.5.2 Security Release
  315.  
  316. * Wed Apr 27 2016 Remi Collet <remi@fedoraproject.org> - 4.5.1-1
  317. - WordPress 4.5.1 Maintenance Release
  318.  
  319. * Wed Apr 13 2016 Remi Collet <remi@fedoraproject.org> - 4.5-1
  320. - WordPress 4.5 “Coleman”
  321.  
  322. * Wed Feb  3 2016 Remi Collet <remi@fedoraproject.org> - 4.4.2-1
  323. - WordPress 4.4.2 Security and Maintenance Release
  324.  
  325. * Thu Jan  7 2016 Remi Collet <remi@fedoraproject.org> - 4.4.1-1
  326. - WordPress 4.4.1 Security and Maintenance Release
  327.  
  328. * Wed Dec  9 2015 Remi Collet <remi@fedoraproject.org> - 4.4-1
  329. - WordPress 4.4 “Clifford”
  330.  
  331. * Wed Sep 16 2015 Remi Collet <remi@fedoraproject.org> - 4.3.1-1
  332. - WordPress 4.3.1 Security and Maintenance Release
  333.  
  334. * Wed Aug 26 2015 Remi Collet <remi@fedoraproject.org> - 4.3-1
  335. - WordPress 4.3 “Billie”
RAW Paste Data