Debian Codegraph @

build/redhat/bochs.rpmspec.template

raw
1 Summary: Bochs Project x86 PC Emulator
2 Name: bochs
3 Version: @SEDVERSION@
4 Release: 1
5 License: LGPL
6 Group: Applications/Emulators
7 URL:https://bochs.sourceforge.io
8 Packager:Volker Ruppert <[email protected]>
9 Source:bochs-@[email protected]
10 BuildRoot: /var/tmp/%{name}-buildroot
11
12 %description
13 Bochs is a highly portable open source IA-32 (x86) PC emulator written
14 in C++, that runs on most popular platforms. It includes emulation of
15 the Intel x86 CPU, common I/O devices, and a custom BIOS. Currently,
16 Bochs can be compiled to emulate a 386, 486, Pentium, Pentium Pro or
17 AMD64 CPU, including optional MMX, SSEx and 3DNow! instructions.
18 Bochs is capable of running most Operating Systems inside the emulation
19 including Linux, DOS, Windows 9X/NT/2000/XP or Windows 7.
20
21 %define pkg_name bochs
22
23 %define _build_id_links none
24
25 %prep
26 rm -rf $RPM_BUILD_DIR/bochs-@SEDVERSION@
27 tar xzvf $RPM_SOURCE_DIR/bochs-@[email protected]
28 if test "/" != $RPM_BUILD_ROOT; then
29 rm -rf $RPM_BUILD_ROOT
30 fi
31 %build
32 cd $RPM_BUILD_DIR/bochs-@SEDVERSION@
33 CONFIGURE_ARGS="--prefix=/usr --mandir=%{_mandir} --libdir=%{_libdir}"
34 export CONFIGURE_ARGS
35 sh .conf.linux
36 make
37 make unpack_dlx # must use prefix=/usr since this step sets up
38 # the paths in dlx bochsrc file.
39 %install
40 pwd
41 cd $RPM_BUILD_DIR/bochs-@SEDVERSION@
42 for i in "" usr usr/bin usr/lib usr/share usr/share/doc %{_mandir}; do
43 if ! test -d $RPM_BUILD_ROOT/$i; then mkdir $RPM_BUILD_ROOT/$i; fi
44 done
45 make install DESTDIR=$RPM_BUILD_ROOT
46 make install_dlx prefix=$RPM_BUILD_ROOT/usr
47 # Build list of plugins on the fly (if any). This allows the
48 # spec file to support RPM building with or without plugins.
49 cd $RPM_BUILD_ROOT
50 # Remove the unwanted *.la files before building the list
51 find -name "*.la" -delete
52 find .%{_libdir} -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > \
53 $RPM_BUILD_DIR/file.list.%{pkg_name}
54 find .%{_libdir} -type f | sed -e 's,^\.,\%attr(-\,root\,root) ,' \
55 -e '/\/etc\//s|^|%config|' >> \
56 $RPM_BUILD_DIR/file.list.%{pkg_name}
57 find .%{_libdir} -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> \
58 $RPM_BUILD_DIR/file.list.%{pkg_name}
59 # We could use the same technique to produce the complete file list,
60 # with only one very minor problem: it lists directories that are
61 # used by other programs, so when you remove the package you get
62 # errors like
63 # error: cannot remove /usr/share/doc - directory not empty
64
65 %files -f file.list.%{pkg_name}
66 %defattr(-, root, root)
67 /usr/bin/bochs
68 /usr/bin/bochs-dlx
69 /usr/bin/bxhub
70 /usr/bin/bximage
71 /usr/share/bochs/*
72 /usr/share/doc/*
73 %{_mandir}/*
74
75 %clean
76 rm -rf $RPM_BUILD_DIR/bochs-@SEDVERSION@
77 rm -rf $RPM_BUILD_DIR/file.list.%{pkg_name}
78 if test "/" != $RPM_BUILD_ROOT; then
79 rm -rf $RPM_BUILD_ROOT
80 fi
81 %preun
82 # clean up the bochsout.txt that is always produced if you
83 # run bochs-dlx.
84 rm -rf /usr/share/bochs/dlxlinux/bochsout.txt
85 %postun
86 rmdir /usr/share/bochs > /dev/null 2>&1