spec文件汇总

%attr(0777,root,root,-) %{_bindir}/*

nginx

Name:           nginx
Version:    1.19.0
Release:        1%{?dist}
Summary:        nginx rpm

Group:        System Environment/Daemons
License:        GPL
URL:            nginx.org
Packager:    vagrant
Vendor:        vagrant
Source0:        %{name}-%{version}.tar.gz
BuildRoot:    %_topdir/BUILDROOT

BuildRequires:  gcc,gcc-c++,pcre-devel,zlib-devel,make,openssl-devel
Requires:       pcre-devel,zlib-devel,openssl-devel

%description
build nginx-1.2.0.tar.gz


%prep
%setup -q


%build export DESTDIR=%{buildroot}
./configure \
--user=nginx \
--group=nginx \
--prefix=/usr/local/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--http-scgi-temp-path=/var/tmp/nginx/scgi \
--with-pcre
make %{?_smp_mflags}


%install
#rm -rf $RPM_BUILD_ROOT
#%make_install
#make install DESTDIR=$RPM_BUILD_ROOT
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}


%clean
#rm -rf ${buildroot}
%files
%doc
%defattr(-,root,root,-)
/etc
/usr
/var



%changelog
* Fri Jun 05 2020 vagrant <vagrant@vagrant.vagrant> - version
- Initial Version

%pre
if [ $1 == 1 ];then
    /usr/sbin/useradd --system nginx 2>/dev/null
fi

%post

%preun
if [ $1 == 0 ];then
    /usr/sbin/userdel --remove nginx
fi

%postun
View Code

intermittent

自己制作的grub2 themes

Name:           intermittent
Version:        1
Release:        1
Summary:        intermittent-grub2 themes

Epoch:        1
Provides:    grub themes
Packager:    occurence
Vendor:        occurence
Group:        System Environment/Base
License:        GPLv2
Distribution:    instrumentation
URL:            http://www.ginpie.com
Source0:        %{name}-%{version}.tar.gz

#BuildRequires:  
#Requires:       
#Conflicts:
BuildArch:    noarch

%description
Provides grub2 themes


%prep
%setup -q


%build


%install
rm -rf $RPM_BUILD_ROOT

install -dm 755 $RPM_BUILD_ROOT/boot/grub2/themes/intermittent
cp -rf * $RPM_BUILD_ROOT/boot/grub2/themes/intermittent
chmod -R 755 $RPM_BUILD_ROOT/boot/grub2/themes/intermittent

%clean
#rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc
/boot/grub2/themes/intermittent



%changelog
* Mon May 16 2020 liu zheng <liuzheng@ginpie.com> - 7-12
- made by liuzheng,yaha

%pre

%post
sed -i 's/^GRUB_TERMINAL_OUTPUT.*$/GRUB_TERMINAL_OUTPUT="gfxterm"/g' /etc/default/grub
sed -i '7 a \GRUB_GFXMODE=1280x1024,1440x900,1024x768,800x600,640x480,auto' /etc/default/grub
sed -i '8 a \GRUB_THEME="/boot/grub2/themes/intermittent/theme.txt"' /etc/default/grub

if [[ -d /sys/firmware/efi ]]
then
        grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
else
        grub2-mkconfig -o /boot/grub2/grub.cfg
fi
%preun
%postun
View Code

 

 这是epel-release.spec文件,从中可以学到不少东西

 1 Name:           epel-release
 2 Version:        7
 3 Release:        12
 4 Summary:        Extra Packages for Enterprise Linux repository configuration
 5 
 6 Group:          System Environment/Base
 7 License:        GPLv2
 8 
 9 # This is a EPEL maintained package which is specific to
10 # our distribution.  Thus the source is only available from
11 # within this srpm.
12 URL:            http://download.fedoraproject.org/pub/epel
13 Source0:        http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
14 Source1:        GPL
15 Source2:        epel.repo
16 Source3:        epel-testing.repo
17 # EPEL default preset policy (borrowed from fedora's 90-default.preset)
18 Source4:        90-epel.preset
19 
20 BuildArch:     noarch
21 Requires:      redhat-release >=  %{version}
22 # epel-release is only for enterprise linux, not fedora
23 Conflicts:     fedora-release
24 
25 %description
26 This package contains the Extra Packages for Enterprise Linux (EPEL) repository
27 GPG key as well as configuration for yum.
28 
29 %prep
30 %setup -q  -c -T
31 install -pm 644 %{SOURCE0} .
32 install -pm 644 %{SOURCE1} .
33 
34 %build
35 
36 
37 %install
38 rm -rf $RPM_BUILD_ROOT
39 
40 #GPG Key
41 install -Dpm 644 %{SOURCE0} \
42     $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
43 
44 # yum
45 install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
46 install -pm 644 %{SOURCE2} %{SOURCE3}  \
47     $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
48 install -pm 644 -D %{SOURCE4} $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system-preset/90-epel.preset
49 
50 %clean
51 rm -rf $RPM_BUILD_ROOT
52 
53 %files
54 %defattr(-,root,root,-)
55 %doc GPL
56 %config(noreplace) /etc/yum.repos.d/*
57 /etc/pki/rpm-gpg/*
58 %{_prefix}/lib/systemd/system-preset/90-epel.preset
59 
60 %changelog
61 * Mon Sep 16 2019 Stephen Smoogen <smooge@fedoraproject.org> - 7-12
62 - Add in &infra and content variables to better understand users of EPEL.
View Code

 

libmad-0.15.1b.spec

 1 Name:           libmad
 2 Version:        0.15.1b
 3 Release:        1%{?dist}
 4 Summary:        no Summary
 5 
 6 License:        GPL
 7 URL:            pppppppppppppp
 8 Source0:        %{name}-%{version}.tar.gz
 9 
10 #BuildRequires:
11 #Requires:       
12 
13 %description
14 
15 
16 %prep
17 %setup -q
18 
19 
20 %build
21 sed -i '/-fforce-mem/d' configure
22 %configure --enable-shared
23 make %{?_smp_mflags}
24 
25 
26 %install
27 rm -rf $RPM_BUILD_ROOT
28 #%make_install
29 make install DESTDIR=$RPM_BUILD_ROOT
30 
31 
32 %files
33 %defattr(-,root,root,-)
34 %doc
35 %{_libdir}/*
36 %{_includedir}/*
37 
38 
39 
40 %changelog
View Code

SDL-release-2.0.10.tar.gz 的spec文件

 1 Summary: Simple DirectMedia Layer
 2 Name: SDL-release
 3 Version: 2.0.10
 4 Release: 2
 5 Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
 6 URL: http://www.libsdl.org/
 7 License: zlib
 8 Group: System Environment/Libraries
 9 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
10 Prefix: %{_prefix}
11 %ifos linux
12 Provides: libSDL2-2.0.so.0
13 %endif
14 
15 %define __defattr %defattr(-,root,root)
16 %define __soext so
17 
18 %description
19 This is the Simple DirectMedia Layer, a generic API that provides low
20 level access to audio, keyboard, mouse, and display framebuffer across
21 multiple platforms.
22 
23 %package devel
24 Summary: Libraries, includes and more to develop SDL applications.
25 Group: Development/Libraries
26 Requires: %{name} = %{version}
27 
28 %description devel
29 This is the Simple DirectMedia Layer, a generic API that provides low
30 level access to audio, keyboard, mouse, and display framebuffer across
31 multiple platforms.
32 
33 This is the libraries, include files and other resources you can use
34 to develop SDL applications.
35 
36 
37 %prep
38 %setup -q 
39 
40 %build
41 %ifos linux
42 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-directfb
43 %else
44 %configure
45 %endif
46 make
47 
48 %install
49 rm -rf $RPM_BUILD_ROOT
50 %ifos linux
51 make install prefix=$RPM_BUILD_ROOT%{prefix} \
52              bindir=$RPM_BUILD_ROOT%{_bindir} \
53              libdir=$RPM_BUILD_ROOT%{_libdir} \
54              includedir=$RPM_BUILD_ROOT%{_includedir} \
55              datadir=$RPM_BUILD_ROOT%{_datadir} \
56              mandir=$RPM_BUILD_ROOT%{_mandir}
57 %else
58 %makeinstall
59 %endif
60 
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63 
64 %files
65 %{__defattr}
66 %doc README*.txt COPYING.txt CREDITS.txt BUGS.txt
67 %{_libdir}/lib*.%{__soext}.*
68 
69 %files devel
70 %{__defattr}
71 %doc docs/README*.md
72 %{_bindir}/*-config
73 %{_libdir}/lib*.a
74 %{_libdir}/lib*.la
75 %{_libdir}/lib*.%{__soext}
76 %{_includedir}/*/*.h
77 %{_libdir}/cmake/*
78 %{_libdir}/pkgconfig/SDL2/*
79 %{_datadir}/aclocal/*
80 
81 %changelog
82 * Thu Jun 04 2015 Ryan C. Gordon <icculus@icculus.org>
83 - Fixed README paths.
View Code

 

  

posted @ 2020-06-05 22:50  ascertain  阅读(421)  评论(0编辑  收藏  举报