]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- fixed 'set -e; echo | false'
[packages/ash.git] / ash.spec
1 # conditional build
2 # --without static
3 # Branch: HEAD
4 Summary:        Small bourne shell from Berkeley
5 Summary(de):    Kleine Bourne-Shell von Berkeley
6 Summary(fr):    Shell Bourne réduit de Berkeley
7 Summary(pl):    Ma³y shell bourne'a
8 Summary(tr):    Ufak bir bourne kabuðu
9 Name:           ash
10 Version:        0.4.0
11 Release:        8
12 License:        BSD
13 Group:          Applications/Shells
14 Source0:        %{name}-%{version}.tar.gz
15 Patch0:         %{name}-builtin.patch
16 Patch1:         %{name}-echo.patch
17 Patch2:         %{name}-getcwd.patch
18 Patch3:         %{name}-getopt.patch
19 Patch4:         %{name}-glob.patch
20 Patch5:         %{name}-jobs.patch
21 Patch6:         %{name}-kill.patch
22 Patch7:         %{name}-makefile.patch
23 Patch8:         %{name}-manpage.patch
24 Patch9:         %{name}-hetio.patch
25 Patch10:        %{name}-memout.patch
26 Patch11:        %{name}-misc.patch
27 Patch12:        %{name}-redir.patch
28 Patch13:        %{name}-setmode.patch
29 Patch14:        %{name}-syntax.patch
30 Patch15:        %{name}-test.patch
31 Patch16:        %{name}-times.patch
32 Patch17:        %{name}-debian.patch
33 Patch18:        %{name}-ppid.patch
34 Patch19:        %{name}-freebsd.patch
35 Patch20:        %{name}-sighup.patch
36 PreReq:         fileutils
37 PreReq:         grep
38 %{!?_without_static:BuildRequires:      glibc-static}
39 BuildRequires:  flex
40 BuildRequires:  byacc
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 Conflicts:      mkinitrd <= 1.7
43
44 %define         _bindir         /bin
45
46 %description
47 ash is a bourne shell clone from Berkeley. It supports all of the
48 standard Bourne shell commands and has the advantage of supporting
49 them while remaining considerably smaller than bash.
50
51 %description -l de
52 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
53 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
54 weniger Platz beansprucht als bash.
55
56 %description -l fr
57 ash est un clone Berkeley du shell Bourne. Il gère toutes les
58 commandes standard du shell Bourne et a l'avantage de les gérer tout
59 en restant considérablement plus petit que bash.
60
61 %description -l pl
62 Ash jest klonem shella Bourne'a z Berkeley. Obs³uguje standardowe
63 komendy shella Bourne'a i jest mniejszy ni¿ bash.
64
65 %description -l tr
66 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
67 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
68 avantajýna sahiptir.
69
70 %package static
71 Summary:        Small bourne shell from Berkeley
72 Summary(de):    Kleine Bourne-Shell von Berkeley
73 Summary(fr):    Shell Bourne réduit de Berkeley
74 Summary(pl):    Ma³y shell bourne'a
75 Summary(tr):    Ufak bir bourne kabuðu
76 Group:          Applications/Shells
77 PreReq:         fileutils
78 PreReq:         grep
79 Conflicts:      mkinitrd <= 1.7
80
81 %description static
82 ash is a bourne shell clone from Berkeley. It supports all of the
83 standard Bourne shell commands and has the advantage of supporting
84 them while remaining considerably smaller than bash.
85
86 %description static -l de
87 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
88 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
89 weniger Platz beansprucht als bash.
90
91 %description static -l fr
92 ash est un clone Berkeley du shell Bourne. Il gère toutes les
93 commandes standard du shell Bourne et a l'avantage de les gérer tout
94 en restant considérablement plus petit que bash.
95
96 %description static -l pl
97 Ash jest klonem shella Bourne'a z Berkeley. Obs³uguje standardowe
98 komendy shella Bourne'a i jest mniejszy ni¿ bash.
99
100 %description static -l tr
101 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
102 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
103 avantajýna sahiptir.
104
105 %prep
106 %setup -q
107 %patch0 -p1
108 %patch1 -p1
109 %patch2 -p1
110 %patch3 -p1
111 %patch4 -p1
112 %patch5 -p1
113 %patch6 -p1
114 %patch7 -p1
115 %patch8 -p1
116 %patch9 -p1
117 %patch10 -p1
118 %patch11 -p1
119 %patch12 -p1
120 %patch13 -p1
121 %patch14 -p1
122 %patch15 -p1
123 %patch16 -p1
124 # this is mainly for information, maybe add changelog to %doc?
125 %patch17 -p1
126 %patch18 -p1
127 %patch19 -p1
128 %patch20 -p1
129
130 %build
131
132 %{!?_without_static:%{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}"}
133 %{!?_without_static:mv -f sh ash.static}
134 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" CC="%{__cc}"
135
136 %install
137 rm -rf $RPM_BUILD_ROOT
138
139 install -d $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1}
140 install sh $RPM_BUILD_ROOT%{_bindir}/ash
141 %{!?_without_static:install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static}
142 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
143 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
144 ln -sf ash $RPM_BUILD_ROOT/%{_bindir}/bsh
145
146 %post
147 if [ ! -f /etc/shells ]; then
148         echo "%{_bindir}/ash" > /etc/shells
149         echo "%{_bindir}/bsh" >> /etc/shells
150 else
151         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
152                 echo "%{_bindir}/ash" >> /etc/shells
153         fi
154         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
155                 echo "%{_bindir}/bsh" >> /etc/shells
156         fi
157 fi
158
159 %post static
160 if [ ! -f /etc/shells ]; then
161         echo "%{_bindir}/ash.static" >> /etc/shells
162 else
163         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
164                 echo "%{_bindir}/ash.static" >> /etc/shells
165         fi
166 fi
167
168 %preun
169 if [ "$1" = 0 ]; then
170         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
171         mv -f /etc/shells.new /etc/shells
172 fi
173
174 %preun static
175 if [ "$1" = 0 ]; then
176         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
177         mv -f /etc/shells.new /etc/shells
178 fi
179
180 %verifyscript
181 for n in ash bsh ; do
182         echo -n "Looking for $n in /etc/shells... "
183         if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
184                 echo "missing"
185                 echo "${n} missing from /etc/shells" >&2
186         else
187                 echo "found"
188         fi
189 done
190
191 %verifyscript static
192 echo -n "Looking for ash.static in /etc/shells... "
193 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
194         echo "missing"
195         echo "ash.static missing from /etc/shells" >&2
196 else
197         echo "found"
198 fi
199
200 %clean
201 rm -rf $RPM_BUILD_ROOT
202
203 %files
204 %defattr(644,root,root,755)
205 %attr(755,root,root) %{_bindir}/ash
206 %attr(755,root,root) %{_bindir}/bsh
207 %{_mandir}/man1/*
208
209 %{!?_without_static:%files static}
210 %{!?_without_static:%defattr(644,root,root,755)}
211 %{!?_without_static:%attr(755,root,root) %{_bindir}/ash.static}
This page took 0.073285 seconds and 4 git commands to generate.