-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpastie.spec
47 lines (37 loc) · 1.01 KB
/
pastie.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Summary: A simple, internal paste bin
Name: pastie
Version: 0
Release: 1
License: AppNexus, Inc.
Group: Applications/Internet
Source: %{name}-%{version}.tar.gz
Vendor: AppNexus, Inc.
Packager: DevOps <[email protected]>
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Requires: nodejs >= 0.12
Requires: redis
%description
Pastie is a paste bin application similar to gist.github.com
%prep
%setup -q
%build
%install
%{__mkdir_p} %{buildroot}/usr/local/adnxs/%{name}/%{version}
%{__cp} -r node_app %{buildroot}/usr/local/adnxs/%{name}/%{version}
%{__mkdir_p} %{buildroot}/etc/init.d
%{__cp} %{name}.init %{buildroot}/etc/init.d/%{name}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
/etc/init.d/%{name}
/usr/local/adnxs/%{name}/%{version}
%post
ln -sfn /usr/local/adnxs/%{name}/%{version} /usr/local/adnxs/%{name}/current
%preun
# stop service when uninstalling [http://stackoverflow.com/questions/8854882]
if [ "$1" == "0" ]; then
sudo service %{name} stop
fi
%postun
rm -rf /usr/local/adnxs/%{name}/%{version}