~ubuntu-branches/ubuntu/wily/ruby-passenger/wily-proposed

« back to all changes in this revision

Viewing changes to rpm/nginx-alternatives.spec

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2013-11-23 23:50:02 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20131123235002-8fdhsq7afj15o2z2
Tags: 4.0.25-1
* New upstream release.
* Refresh fix_install_path.patch.
* Build for Ruby 2.0 instead of 1.8. (Closes: #725591)
* Add fix_ftbfs_fortify_source.patch.
* Install passenger template files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# RPM Spec file for nginx-alternatives
 
2
# This is a stop-gap solution to having multiple compiles of nginx on
 
3
# the same server.
 
4
#
 
5
# This package is meant to be obsoleted by a future nginx package that
 
6
# will provide the same feature
 
7
 
 
8
%define perldir %(perl -MConfig -e 'print $Config{installarchlib}')
 
9
 
 
10
Summary: Alternatives aware nginx
 
11
Name: nginx-alternatives
 
12
Version: 0.0.1
 
13
Release: 3%{?dist}
 
14
License: MIT
 
15
Group: System Environment/Daemons
 
16
#Source0: %{name}-%{version}.tar.gz
 
17
Source0: README.%{name}
 
18
Requires: nginx
 
19
BuildArch: noarch
 
20
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 
21
 
 
22
%description
 
23
This package puts the nginx webserver binary under the control of the
 
24
/etc/alternative system.
 
25
 
 
26
This package is meant to be obsoleted by a future nginx package (which
 
27
will provide the same feature)
 
28
 
 
29
%prep
 
30
#%setup -q
 
31
 
 
32
%build
 
33
cp %{SOURCE0} .
 
34
 
 
35
%install
 
36
rm -rf $RPM_BUILD_ROOT
 
37
mkdir -p $RPM_BUILD_ROOT
 
38
 
 
39
%clean
 
40
rm -rf $RPM_BUILD_ROOT
 
41
 
 
42
%triggerin -- nginx
 
43
if [ ! -L /usr/sbin/nginx ] ; then
 
44
  mv /usr/sbin/nginx /usr/sbin/nginx.base
 
45
  mv %{perldir}/auto/nginx/nginx.so  %{perldir}/auto/nginx/nginx_base.so
 
46
  mv %{perldir}/nginx.pm  %{perldir}/nginx_base.pm
 
47
  mv %{_mandir}/man3/nginx.3pm.gz %{_mandir}/man3/nginx_base.3pm.gz
 
48
 
 
49
  /usr/sbin/alternatives --install /usr/sbin/nginx nginx \
 
50
                                   /usr/sbin/nginx.base 30 \
 
51
    --slave %{perldir}/auto/nginx/nginx.so nginx.so \
 
52
            %{perldir}/auto/nginx/nginx_base.so \
 
53
    --slave %{perldir}/nginx.pm nginx.pm %{perldir}/nginx_base.pm \
 
54
    --slave %{_mandir}/man3/nginx.3pm.gz nginx.man \
 
55
            %{_mandir}/man3/nginx_base.3pm.gz
 
56
fi
 
57
 
 
58
# Given that other packages will depend on this one, it's 99% likely
 
59
# that this will have been reset back to base. Still good practice to
 
60
# put the expected binary back in place.
 
61
%define undo_link \
 
62
  bin=`readlink -f /usr/sbin/nginx` \
 
63
  so=`readlink -f %{perldir}/auto/nginx/nginx.so` \
 
64
  pm=`readlink -f %{perldir}/nginx.pm` \
 
65
  man=`readlink -f %{_mandir}/man3/nginx.3pm.gz` \
 
66
  /usr/sbin/alternatives --remove nginx /usr/sbin/nginx.base \
 
67
  /usr/sbin/alternatives --remove nginx $bin \
 
68
  mv -f $bin /usr/sbin/nginx \
 
69
  mv -f $so %{perldir}/auto/nginx/nginx.so \
 
70
  mv -f $pm %{perldir}/nginx.pm \
 
71
  mv -f $man %{_mandir}/man3/nginx.3pm.gz
 
72
 
 
73
 
 
74
%triggerun -- nginx
 
75
if [ -L /usr/sbin/nginx ] ; then
 
76
  %undo_link
 
77
fi
 
78
 
 
79
# triggerun runs if either package is removed, so this isn't necessary
 
80
%postun
 
81
if [ $1 == 0 -a -L /usr/sbin/nginx ]; then
 
82
  %undo_link
 
83
fi
 
84
 
 
85
%files
 
86
%defattr(-,root,root,-)
 
87
%doc README.%{name}
 
88
 
 
89
%changelog
 
90
* Sat Oct 30 2010 Erik Ogan <erik@stealthymonkeys.com> - 0.0.1-3
 
91
- Add slaves for the perl module
 
92
 
 
93
* Thu Oct 21 2010 Erik Ogan <erik@stealthymonkeys.com> - 0.0.1-2
 
94
- Use triggers to maintain the link if nginx package is upgraded
 
95
 
 
96
* Wed Oct 20 2010 Erik Ogan <erik@stealthymonkeys.com> - 0.0.1-1
 
97
- Initial build.