-
Notifications
You must be signed in to change notification settings - Fork 1
/
qmailtoaster-release.spec
148 lines (128 loc) · 5.23 KB
/
qmailtoaster-release.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# $Id$
# Authority: shubes
# Upstream: Eric Shubert <[email protected]>
Name: qmailtoaster-release
Summary: QMailToaster RPM repository configuration
Version: 2.0
Release: 1%{?dist}
License: GPL
Group: System Environment/Base
Vendor: QmailToaster
Packager: Eric Shubert <[email protected]>
URL: http://qmailtoaster.com/
Source1: qt-whatami
Source2: qmailtoaster-nodist.repo
Source3: qmailtoaster-centos.repo
Source4: qmailtoaster-fedora.repo
Source5: qmailtoaster-mandriva.repo
Source6: qmailtoaster-suse.repo
Source7: RPM_GPG_KEY-qmailtoaster
Source8: RPM_GPG_KEY-shubes
Requires: yum-priorities
BuildArch: noarch
BuildRoot: %{_topdir}/BUILDROOT/%{name}-%{version}-%{release}.%{_arch}
%define BASE_DIR /opt/%{name}
%define BIN_DIR %{BASE_DIR}/bin
%define CONF_DIR %{BASE_DIR}/etc
%define BIN_LINK %{_bindir}
%define REPO_LINK %{_sysconfdir}/yum.repos.d
#-------------------------------------------------------------------------------
%description
#-------------------------------------------------------------------------------
This package contains yum configuration files for the QMailToaster RPM
Repository, as well as the public GPG keys for verifying them.
It also includes a script for determining which distro the host is running,
to aid with installation and support.
#-------------------------------------------------------------------------------
%prep
#-------------------------------------------------------------------------------
%setup -cT
#-------------------------------------------------------------------------------
%install
#-------------------------------------------------------------------------------
%{__rm} -rf %{buildroot}
%{__mkdir_p} %{buildroot}%{BIN_DIR}
%{__mkdir_p} %{buildroot}%{CONF_DIR}
%{__mkdir_p} %{buildroot}%{BIN_LINK}
%{__mkdir_p} %{buildroot}%{REPO_LINK}
%{__install} -p %{SOURCE1} %{buildroot}%{BIN_DIR}/qt-whatami
%{__install} -p %{SOURCE2} %{buildroot}%{CONF_DIR}/qmailtoaster-nodist.repo
%{__install} -p %{SOURCE3} %{buildroot}%{CONF_DIR}/qmailtoaster-centos.repo
%{__install} -p %{SOURCE4} %{buildroot}%{CONF_DIR}/qmailtoaster-fedora.repo
%{__install} -p %{SOURCE5} %{buildroot}%{CONF_DIR}/qmailtoaster-mandriva.repo
%{__install} -p %{SOURCE6} %{buildroot}%{CONF_DIR}/qmailtoaster-suse.repo
%{__install} -p %{_sourcedir}/RPM_GPG_KEY-qmailtoaster \
%{buildroot}%{CONF_DIR}/RPM_GPG_KEY-qmailtoaster
%{__install} -p %{_sourcedir}/RPM_GPG_KEY-shubes \
%{buildroot}%{CONF_DIR}/RPM_GPG_KEY-shubes
%{__ln_s} ../..%{BIN_DIR}/qt-whatami %{buildroot}%{BIN_LINK}/.
%{__ln_s} ../..%{CONF_DIR}/qmailtoaster-nodist.repo %{buildroot}%{REPO_LINK}/.
touch %{buildroot}%{REPO_LINK}/qmailtoaster-dist.repo
#-------------------------------------------------------------------------------
%clean
#-------------------------------------------------------------------------------
%{__rm} -rf %{buildroot}
#-------------------------------------------------------------------------------
%files
#-------------------------------------------------------------------------------
%defattr(0644, root, root, 0755)
# shubes - this is from repoforge-release - don't know what %pubkey does
# %pubkey RPM_GPG_KEY-qmailtoaster
# %pubkey RPM_GPG_KEY-shubes
# directories
%dir %{BASE_DIR}
%dir %{BIN_DIR}
%dir %{CONF_DIR}
# files
%attr(0755, root, root) %{BIN_DIR}/*
%config(noreplace) %{CONF_DIR}/*
# symlinks
%{BIN_LINK}/*
%{REPO_LINK}/qmailtoaster-nodist.repo
%ghost %{REPO_LINK}/qmailtoaster-dist.repo
#-------------------------------------------------------------------------------
%post
#-------------------------------------------------------------------------------
. qt-whatami -s
case $DISTRO in
CentOS )
%{__ln_s} ../..%{CONF_DIR}/qmailtoaster-centos.repo \
%{REPO_LINK}/qmailtoaster-dist.repo
;;
Fedora )
%{__ln_s} ../..%{CONF_DIR}/qmailtoaster-fedora.repo \
%{REPO_LINK}/qmailtoaster-dist.repo
;;
Mandriva )
%{__ln_s} ../..%{CONF_DIR}/qmailtoaster-mandriva.repo \
%{REPO_LINK}/qmailtoaster-dist.repo
;;
SuSE )
%{__ln_s} ../..%{CONF_DIR}/qmailtoaster-suse.repo \
%{REPO_LINK}/qmailtoaster-dist.repo
;;
* )
echo "DISTRO not determined:"
qt-whatami
echo "ERROR: Please contact support"
;;
esac
rpm -q gpg-pubkey-4728f6b5-52900fa3 &>/dev/null || \
rpm --import %{CONF_DIR}/RPM_GPG_KEY-qmailtoaster || :
rpm -q gpg-pubkey-93c761fd-528fd585 &>/dev/null || \
rpm --import %{CONF_DIR}/RPM_GPG_KEY-shubes || :
co_parm="check_obsoletes=1"
pcfile=/etc/yum/pluginconf.d/priorities.conf
grep "$co_parm" $pcfile >/dev/null 2>&1 || \
echo "$co_parm" >> $pcfile
#-------------------------------------------------------------------------------
%changelog
#-------------------------------------------------------------------------------
* Fri Dec 27 2013 Eric Shubert <[email protected]> - 2.0-1.qt
- changed qmailtoaster.repo to qmailtoaster-nodist.repo
- changed to use %{SOURCEn} names
* Sat Dec 07 2013 Eric Shubert <[email protected]> - 2.0-1.qt
* removed qt-install-repoforge from %post, as that won't work (recursive rpm)
- changed symlink name and made it a ghost
* Sat Nov 23 2013 Eric Shubert <[email protected]> - 2.0-0.qt
- Initial package.