]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- added contitional BOOT build
[packages/ash.git] / ash.spec
1 # conditional build:
2 # if BOOT is defined, build BOOT package too
3 Summary:        Small bourne shell from Berkeley
4 Summary(de):    Kleine Bourne-Shell von Berkeley
5 Summary(fr):    Shell Bourne réduit de Berkeley
6 Summary(pl):    Ma³y shell bourne'a 
7 Summary(tr):    Ufak bir bourne kabuðu
8 Name:           ash
9 Version:        0.3.1
10 Release:        1
11 License:        BSD
12 Group:          Applications/Shells
13 Group(de):      Applikationen/Shells
14 Group(pl):      Aplikacje/Pow³oki
15 Source0:        ftp://ftp.pld.org.pl/people/malekith/%{name}-linux-%{version}.tar.gz
16 Patch0:         %{name}-Makefile.patch
17 Prereq:         fileutils
18 Prereq:         grep
19 BuildRequires:  glibc-static
20 %{?BOOT:BuildRequires:  uClibc-devel-BOOT}
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 Conflicts:      mkinitrd <= 1.7
23
24 %define         _bindir         /bin
25
26 %description
27 ash is a bourne shell clone from Berkeley. It supports all of the
28 standard Bourne shell commands and has the advantage of supporting
29 them while remaining considerably smaller than bash.
30
31 %description -l de
32 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
33 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
34 weniger Platz beansprucht als bash.
35
36 %description -l fr
37 ash est un clone Berkeley du shell Bourne. Il gère toutes les
38 commandes standard du shell Bourne et a l'avantage de les gérer tout
39 en restant considérablement plus petit que bash.
40
41 %description -l pl
42 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
43 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
44
45 %description -l tr
46 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
47 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
48 avantajýna sahiptir.
49
50 %package static
51 Summary:        Small bourne shell from Berkeley
52 Summary(de):    Kleine Bourne-Shell von Berkeley
53 Summary(fr):    Shell Bourne réduit de Berkeley
54 Summary(pl):    Ma³y shell bourne'a 
55 Summary(tr):    Ufak bir bourne kabuðu
56 Group:          Applications/Shells
57 Group(de):      Applikationen/Shells
58 Group(pl):      Aplikacje/Pow³oki
59 Prereq:         fileutils
60 Prereq:         grep
61 Conflicts:      mkinitrd <= 1.7
62
63 %description static
64 ash is a bourne shell clone from Berkeley. It supports all of the
65 standard Bourne shell commands and has the advantage of supporting
66 them while remaining considerably smaller than bash.
67
68 %description static -l de
69 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
70 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
71 weniger Platz beansprucht als bash.
72
73 %description static -l fr
74 ash est un clone Berkeley du shell Bourne. Il gère toutes les
75 commandes standard du shell Bourne et a l'avantage de les gérer tout
76 en restant considérablement plus petit que bash.
77
78 %description static -l pl
79 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
80 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
81
82 %description static -l tr
83 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
84 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
85 avantajýna sahiptir.
86
87 %if %{?BOOT:1}%{!?BOOT:0}
88 %package BOOT
89 Summary:        Small bourne shell from Berkeley
90 Summary(de):    Kleine Bourne-Shell von Berkeley
91 Summary(fr):    Shell Bourne réduit de Berkeley
92 Summary(pl):    Ma³y shell bourne'a 
93 Summary(tr):    Ufak bir bourne kabuðu
94 Group:          Applications/Shells
95 Group(de):      Applikationen/Shells
96 Group(pl):      Aplikacje/Pow³oki
97
98 %description BOOT
99 ash is a bourne shell clone from Berkeley. It supports all of the
100 standard Bourne shell commands and has the advantage of supporting
101 them while remaining considerably smaller than bash.
102 Version for bootdisk
103
104 %endif
105
106 %prep
107 %setup -q -n ash-linux-%{version}
108 %patch -p1
109
110 %build
111 # BOOT
112 %if %{?BOOT:1}%{!?BOOT:0}
113 %{__make} \
114         OPT_FLAGS="-I/usr/lib/bootdisk%{_includedir} -Os" \
115         LDFLAGS="-nostdlib -s" \
116         LDLIBS="%{_libdir}/bootdisk%{_libdir}/crt0.o %{_libdir}/bootdisk%{_libdir}/libc.a -lgcc"
117 mv -f sh ash.BOOT
118 %{__make} clean
119 %endif
120
121 # other
122 %{__make} OPT_FLAGS="%{?debug:-O0 -g}%{!?debug:$RPM_OPT_FLAGS}" \
123         LDFLAGS="-static %{!?debug:-s}"
124 mv -f sh ash.static
125 %{__make} OPT_FLAGS="%{?debug:-O0 -g}%{!?debug:$RPM_OPT_FLAGS}" \
126         LDFLAGS="%{!?debug:-s}"
127
128
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132
133 # BOOT
134 %if %{?BOOT:1}%{!?BOOT:0}
135 install -d $RPM_BUILD_ROOT/usr/lib/bootdisk/bin
136 install -s ash.BOOT $RPM_BUILD_ROOT/usr/lib/bootdisk/bin/ash
137 ln -s ash $RPM_BUILD_ROOT/usr/lib/bootdisk/bin/sh
138 %endif
139
140 # other
141 install -d $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1}
142 install sh $RPM_BUILD_ROOT%{_bindir}/ash
143 install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static
144 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
145 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
146 ln -sf ash $RPM_BUILD_ROOT/%{_bindir}/bsh
147
148 %post
149 if [ ! -f /etc/shells ]; then
150         echo "%{_bindir}/ash" > /etc/shells
151         echo "%{_bindir}/bsh" >> /etc/shells
152 else
153         if ! grep '^%{_bindir}/ash$' /etc/shells > /dev/null; then
154                 echo "%{_bindir}/ash" >> /etc/shells
155         fi
156         if ! grep '^%{_bindir}/bsh$' /etc/shells > /dev/null; then
157                 echo "%{_bindir}/bsh" >> /etc/shells
158         fi
159 fi
160
161 %post static
162 if [ ! -f /etc/shells ]; then
163         echo "%{_bindir}/ash.static" >> /etc/shells
164 else
165         if ! grep '^%{_bindir}/ash.static$' /etc/shells > /dev/null; then
166                 echo "%{_bindir}/ash.static" >> /etc/shells
167         fi
168 fi
169
170 %preun
171 if [ "$0" = 0 ]; then
172         grep -v %{_bindir}/ash /etc/shells | grep -v %{_bindir}/bsh | grep -v %{_bindir}/ash.static > /etc/shells.new
173         mv -f /etc/shells.new /etc/shells
174 fi
175
176 %preun static
177 if [ "$0" = 0 ]; then
178         grep -v %{_bindir}/ash /etc/shells | grep -v %{_bindir}/bsh > /etc/shells.new
179         mv -f /etc/shells.new /etc/shells
180 fi
181
182 %verifyscript
183 for n in ash bsh ash.static; do
184     echo -n "Looking for $n in /etc/shells... "
185     if ! grep "^%{_bindir}/${n}\$" /etc/shells > /dev/null; then
186         echo "missing"
187         echo "${n} missing from /etc/shells" >&2
188     else
189         echo "found"
190     fi
191 done
192
193 %clean
194 rm -rf $RPM_BUILD_ROOT
195
196 %files
197 %defattr(644,root,root,755)
198 %attr(755,root,root) %{_bindir}/ash
199 %attr(755,root,root) %{_bindir}/bsh
200 %{_mandir}/man1/*
201
202 %files static
203 %defattr(644,root,root,755)
204 %attr(755,root,root) %{_bindir}/ash.static
205
206 %if %{?BOOT:1}%{!?BOOT:0}
207 %files BOOT
208 %defattr(644,root,root,755)
209 %attr(755,root,root) /usr/lib/bootdisk/bin/*
210 %endif
This page took 0.103917 seconds and 4 git commands to generate.