Commit 49d5a18f5d75e732ad0bae8e713d55663f28b040
1 parent
e7369bb0
Exists in
spec_refactor
Adds new macros to noosfero
- Adds noosfero_etcdir macro - Adds /etc/init.d macro
Showing
1 changed file
with
27 additions
and
16 deletions
Show diff stats
src/pkg-rpm/noosfero/noosfero.spec
| 1 | %define writable_dirs articles image_uploads thumbnails | 1 | %define writable_dirs articles image_uploads thumbnails |
| 2 | %define cache_dirs javascripts/cache stylesheets/cache | 2 | %define cache_dirs javascripts/cache stylesheets/cache |
| 3 | 3 | ||
| 4 | +%global noosfero_etcdir /etc/noosfero | ||
| 5 | +# Using this intead of %{_libdir}, because noosfero it's noarch | ||
| 6 | +%global noosfero_libdir /usr/lib/noosfero | ||
| 7 | +%global _initdir /etc/init.d | ||
| 8 | + | ||
| 4 | Name: noosfero | 9 | Name: noosfero |
| 5 | Version: 1.3.1+spb2 | 10 | Version: 1.3.1+spb2 |
| 6 | Release: 6.1 | 11 | Release: 6.1 |
| @@ -10,8 +15,16 @@ License: AGPLv3 | @@ -10,8 +15,16 @@ License: AGPLv3 | ||
| 10 | URL: http://noosfero.org | 15 | URL: http://noosfero.org |
| 11 | Source0: %{name}-%{version}.tar.gz | 16 | Source0: %{name}-%{version}.tar.gz |
| 12 | BuildArch: noarch | 17 | BuildArch: noarch |
| 13 | -BuildRequires: noosfero-deps >= 1.3-3, gettext, po4a | ||
| 14 | -Requires: noosfero-deps, po4a, tango-icon-theme, memcached,crontabs, nodejs | 18 | +BuildRequires: noosfero-deps >= 1.3-3 |
| 19 | +BuildRequires: gettext | ||
| 20 | +BuildRequires: po4a | ||
| 21 | +Requires: ruby(release) | ||
| 22 | +Requires: noosfero-deps | ||
| 23 | +Requires: po4a | ||
| 24 | +Requires: tango-icon-theme | ||
| 25 | +Requires: memcached | ||
| 26 | +Requires: crontabs | ||
| 27 | +Requires: nodejs | ||
| 15 | 28 | ||
| 16 | %description | 29 | %description |
| 17 | Noosfero is a web platform for social and solidarity economy networks with blog, | 30 | Noosfero is a web platform for social and solidarity economy networks with blog, |
| @@ -33,7 +46,7 @@ rm -f build.log Gemfile Gemfile.lock .bundle vendor/bundle | @@ -33,7 +46,7 @@ rm -f build.log Gemfile Gemfile.lock .bundle vendor/bundle | ||
| 33 | rm -rf tmp log | 46 | rm -rf tmp log |
| 34 | 47 | ||
| 35 | %install | 48 | %install |
| 36 | -mkdir -p %{buildroot}/usr/lib/noosfero | 49 | +mkdir -p %{buildroot}%{noosfero_libdir} |
| 37 | 50 | ||
| 38 | # install noosfero tree | 51 | # install noosfero tree |
| 39 | cp -r * %{buildroot}/usr/lib/noosfero/ | 52 | cp -r * %{buildroot}/usr/lib/noosfero/ |
| @@ -44,16 +57,14 @@ rm -rf %{buildroot}/usr/lib/noosfero/debian | @@ -44,16 +57,14 @@ rm -rf %{buildroot}/usr/lib/noosfero/debian | ||
| 44 | rm -rf %{buildroot}/usr/lib/noosfero/config/plugins | 57 | rm -rf %{buildroot}/usr/lib/noosfero/config/plugins |
| 45 | 58 | ||
| 46 | # install config files | 59 | # install config files |
| 47 | -mkdir -p %{buildroot}/etc/init.d | ||
| 48 | -cp etc/init.d/noosfero %{buildroot}/etc/init.d/ | ||
| 49 | - | ||
| 50 | -mkdir -p %{buildroot}/etc/noosfero/plugins | ||
| 51 | -ln -sf /etc/noosfero/database.yml %{buildroot}/usr/lib/noosfero/config/database.yml | ||
| 52 | -ln -sf /etc/noosfero/unicorn.rb %{buildroot}/usr/lib/noosfero/config/unicorn.rb | 60 | +mkdir -p %{buildroot}%{_initdir} |
| 61 | +cp etc/init.d/noosfero %{buildroot}%{_initdir}/ | ||
| 53 | 62 | ||
| 54 | -mkdir -p %{buildroot}/etc/noosfero/plugins | ||
| 55 | -cp config/plugins/README %{buildroot}/etc/noosfero/plugins | ||
| 56 | -ln -sfT /etc/noosfero/plugins %{buildroot}/usr/lib/noosfero/config/plugins | 63 | +mkdir -p %{buildroot}%{noosfero_etcdir}/plugins |
| 64 | +ln -sf %{noosfero_etcdir}/database.yml %{buildroot}%{noosfero_libdir}/config/database.yml | ||
| 65 | +ln -sf %{noosfero_etcdir}/unicorn.rb %{buildroot}%{noosfero_libdir}/config/unicorn.rb | ||
| 66 | +cp config/plugins/README %{buildroot}%{noosfero_etcdir}/plugins | ||
| 67 | +ln -sfT %{noosfero_etcdir}/plugins %{buildroot}%{noosfero_libdir}/config/plugins | ||
| 57 | 68 | ||
| 58 | # symlink needed bits in public/ | 69 | # symlink needed bits in public/ |
| 59 | for dir in %{writable_dirs}; do | 70 | for dir in %{writable_dirs}; do |
| @@ -113,7 +124,7 @@ mkdir -p /var/lib/noosfero/cache | @@ -113,7 +124,7 @@ mkdir -p /var/lib/noosfero/cache | ||
| 113 | 124 | ||
| 114 | chown -R noosfero:noosfero /var/lib/noosfero | 125 | chown -R noosfero:noosfero /var/lib/noosfero |
| 115 | 126 | ||
| 116 | -/etc/init.d/noosfero setup | 127 | +%{_initdir}/noosfero setup |
| 117 | 128 | ||
| 118 | cd /usr/lib/noosfero/ | 129 | cd /usr/lib/noosfero/ |
| 119 | 130 | ||
| @@ -143,9 +154,9 @@ service noosfero stop | @@ -143,9 +154,9 @@ service noosfero stop | ||
| 143 | chkconfig --del noosfero | 154 | chkconfig --del noosfero |
| 144 | 155 | ||
| 145 | %files | 156 | %files |
| 146 | -/usr/lib/noosfero | ||
| 147 | -/etc/init.d/noosfero | ||
| 148 | -/etc/noosfero/plugins/README | 157 | +%{noosfero_libdir} |
| 158 | +%{_initdir}/noosfero | ||
| 159 | +%doc %{noosfero_etcdir}/plugins/README | ||
| 149 | %config(noreplace) /etc/default/noosfero | 160 | %config(noreplace) /etc/default/noosfero |
| 150 | %config(noreplace) /etc/noosfero/database.yml | 161 | %config(noreplace) /etc/noosfero/database.yml |
| 151 | %config(noreplace) /etc/noosfero/unicorn.rb | 162 | %config(noreplace) /etc/noosfero/unicorn.rb |