Apply ASLR to attr
[platform/upstream/attr.git] / packaging / attr.spec
1 Name:           attr
2 %define lname   libattr
3 Summary:        Commands for Manipulating Extended Attributes
4 License:        GPL-2.0+ and LGPL-2.1+
5 Group:          Base/File Systems
6 Version:        2.4.47
7 Release:        0
8 Source:         %{name}-%{version}.src.tar.gz
9 Source1:        xattr.conf
10 Source2:        baselibs.conf
11 Source1001:     attr.manifest
12 Url:            http://download.savannah.gnu.org/releases-noredirect/attr/
13 BuildRequires:  autoconf
14
15 %description
16 A set of tools for manipulating extended attributes on file system
17 objects, in particular getfattr(1) and setfattr(1). An attr(1) command
18 is also provided, which is largely compatible with the SGI IRIX tool of
19 the same name.
20
21 %package -n %lname
22 Summary:        A dynamic library for filesystem extended attribute support
23 Group:          Base/File Systems
24
25 %description -n %lname
26 This package contains the libattr.so dynamic library, which contains
27 the extended attribute library functions.
28
29 %package -n libattr-devel
30 Summary:        Include Files and Libraries mandatory for Development
31 Group:          Development/Libraries
32 Provides:       attr-devel
33 Obsoletes:      attr-devel
34 Requires:       %lname = %version
35 Requires:       glibc-devel
36
37 %description -n libattr-devel
38 This package contains the libraries and header files needed to develop
39 programs which make use of extended attributes. For Linux programs, the
40 documented system call API is the recommended interface, but an SGI
41 IRIX compatibility interface is also provided.
42
43 %package -n libattr-devel-static
44 Summary:        Include Files and Libraries mandatory for Development
45 Group:          Development/Libraries
46 Provides:       libattr-devel:%{_libdir}/libattr.a
47 Requires:       libattr-devel = %version
48
49 %description -n libattr-devel-static
50 This package contains the static library of libattr which is needed to develop
51 statically linked programs which make use of extended attributes.
52
53 %prep
54 %setup -q
55 cp %{SOURCE1001} .
56
57 %build
58 export OPTIMIZER="$RPM_OPT_FLAGS"
59 export DEBUG=-DNDEBUG
60 CFLAGS="$RPM_OPT_FLAGS" \
61 %configure \
62         --prefix=/ \
63         --enable-gettext=no \
64         --exec-prefix=/ \
65         --sbindir=%_sbindir \
66         --libdir=%{_libdir} \
67         --libexecdir=%{_libdir} \
68         --with-pic
69 %{__make} libattr %{?_smp_mflags}
70 CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" \
71 %{__make} attr getfattr setfattr %{?_smp_mflags}
72
73 %install
74 DIST_ROOT="$RPM_BUILD_ROOT"
75 DIST_INSTALL=`pwd`/install.manifest
76 DIST_INSTALL_DEV=`pwd`/install-dev.manifest
77 DIST_INSTALL_LIB=`pwd`/install-lib.manifest
78 export DIST_ROOT DIST_INSTALL DIST_INSTALL_DEV DIST_INSTALL_LIB
79 /usr/bin/make install DIST_MANIFEST="$DIST_INSTALL"
80 /usr/bin/make install-dev DIST_MANIFEST="$DIST_INSTALL_DEV"
81 /usr/bin/make install-lib DIST_MANIFEST="$DIST_INSTALL_LIB"
82 rm -f $RPM_BUILD_ROOT%{_mandir}/man2/*xattr.2*
83 rm -f $RPM_BUILD_ROOT/%{_libdir}/libattr.la
84 install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}
85 install -m 644 %_sourcedir/xattr.conf $RPM_BUILD_ROOT/%{_sysconfdir}
86 chmod 755 $RPM_BUILD_ROOT/%{_libdir}/libattr.so.1*
87
88 %remove_docs
89
90 %post -n %lname -p /sbin/ldconfig
91
92 %postun -n %lname -p /sbin/ldconfig
93
94 %files
95 %manifest %{name}.manifest
96 %defattr (-,root,root)
97 %license doc/COPYING
98 %attr(755,root,root) %{_bindir}/attr
99 %attr(755,root,root) %{_bindir}/getfattr
100 %attr(755,root,root) %{_bindir}/setfattr
101
102 %files -n libattr-devel
103 %manifest %{name}.manifest
104 %defattr(-,root,root)
105 %dir %attr(755,root,root) %{_includedir}/attr
106 %attr(644,root,root) %{_includedir}/attr/attributes.h
107 %attr(644,root,root) %{_includedir}/attr/error_context.h
108 %attr(644,root,root) %{_includedir}/attr/libattr.h
109 %attr(644,root,root) %{_includedir}/attr/xattr.h
110 %attr(755,root,root) %{_libdir}/libattr.so
111
112 %files -n libattr-devel-static
113 %manifest %{name}.manifest
114 %defattr(-,root,root)
115 %{_libdir}/libattr.a
116
117 %files -n %lname
118 %manifest %{name}.manifest
119 %defattr (-,root,root)
120 %license doc/COPYING.LGPL
121 %{_libdir}/libattr.so.1*
122 %config %{_sysconfdir}/xattr.conf
123
124 %changelog