]> git.pld-linux.org Git - packages/linux-gpib.git/blob - linux-gpib.spec
- initial.
[packages/linux-gpib.git] / linux-gpib.spec
1 #
2 # Replace MODULE_NAME with real module name and MODULE_DIR
3 # with required directory name.
4 #
5 # Conditional build:
6 %bcond_without  dist_kernel     # allow non-distribution kernel
7 %bcond_without  kernel          # don't build kernel modules
8 %bcond_without  smp             # don't build SMP module
9 %bcond_without  userspace       # don't build userspace module
10 %bcond_with     verbose         # verbose build (V=1)
11 #
12 # main package.
13 #
14 Summary:        GPIB Linux Support
15 Summary(pl):    Sterowniki GPIB dkla Linuksa
16 Name:           linux-gpib
17 Version:        3.2.05
18 %define         _rel    0.1
19 Release:        %{_rel}
20 #Epoch:         
21 License:        GPL
22 Group:          Unknown
23 Vendor:         PLD
24 #Icon:          -
25 Source0:        http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
26 # Source0-md5:  -
27 #Source1:       -
28 # Source1-md5:  -
29 #Patch0:                %{name}-what.patch
30 URL:            http://linux-gpib.sourceforge.net/
31 %if %{with kernel}
32 %{?with_dist_kernel:BuildRequires:      kernel-module-build >= 2.6.7}
33 BuildRequires:  rpmbuild(macros) >= 1.153
34 %endif
35 BuildRequires:  kernel-headers >= 2.6.8
36 PreReq:         -
37 Requires(pre,post):     kernel >= 2.6.8
38 Requires(preun):        -
39 Requires(postun):       -
40 Requires:       kernel_up >=2.6.8
41 Provides:       -
42 Obsoletes:      -
43 Conflicts:      -
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %description
47
48 %description -l pl
49
50 # kernel subpackages.
51 %prep
52
53 %build
54
55 %if %{with kernel}
56 # kernel module(s)
57 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
58         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
59                 exit 1
60         fi
61         rm -rf include
62         install -d include/{linux,config}
63         ln -sf %{_kernelsrcdir}/config-$cfg .config
64         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
65         ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
66         touch include/config/MARKER
67 #
68 #       patching/creating makefile(s) (optional)
69 #
70         %{__make} -C %{_kernelsrcdir} clean \
71                 RCS_FIND_IGNORE="-name '*.ko' -o" \
72                 M=$PWD O=$PWD \
73                 %{?with_verbose:V=1}
74         %{__make} -C %{_kernelsrcdir} modules \
75                 CC="%{__cc}" CPP="%{__cpp}" \
76                 M=$PWD O=$PWD \
77                 %{?with_verbose:V=1}
78
79         mv MODULE_NAME{,-$cfg}.ko
80 done
81 %endif
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85
86 %if %{with userspace}
87
88
89 %endif
90
91 %if %{with kernel}
92 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/MODULE_DIR
93 install MODULE_NAME-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
94         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/MODULE_DIR/MODULE_NAME.ko
95 %if %{with smp} && %{with dist_kernel}
96 install MODULE_NAME-smp.ko \
97         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/MODULE_DIR/MODULE_NAME.ko
98 %endif
99 %endif
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %post   -n kernel-MODULE_DIR-%{name}
105 %depmod %{_kernel_ver}
106
107 %postun -n kernel-MODULE_DIR-%{name}
108 %depmod %{_kernel_ver}
109
110 %post   -n kernel-smp-MODULE_DIR-%{name}
111 %depmod %{_kernel_ver}smp
112
113 %postun -n kernel-smp-MODULE_DIR-%{name}
114 %depmod %{_kernel_ver}smp
115
116 %if %{with kernel}
117 %files -n kernel-MODULE_DIR-%{name}
118 %defattr(644,root,root,755)
119 /lib/modules/%{_kernel_ver}/MODULE_DIR/*.ko*
120
121 %if %{with smp} && %{with dist_kernel}
122 %files -n kernel-smp-MODULE_DIR-%{name}
123 %defattr(644,root,root,755)
124 /lib/modules/%{_kernel_ver}smp/MODULE_DIR/*.ko*
125 %endif
126 %endif
127
128 %if %{with userspace}
129 %files
130 %defattr(644,root,root,755)
131
132 %endif
This page took 0.033057 seconds and 4 git commands to generate.