Rebase for lua 5.1.5
[platform/upstream/lua.git] / packaging / lua.spec
1 Name:           lua
2 Version:        5.1.4
3 Release:        0
4 License:        MIT
5 Summary:        Small Embeddable Language with Simple Procedural Syntax
6 Url:            http://www.lua.org
7 Group:          Base/Libraries
8 Source:         %{name}-%{version}.tar.gz
9 Source1:        macros.lua
10 Source2:        baselibs.conf
11 Source1001:     lua.manifest
12 %define major_version 5.1
13 BuildRequires:  pkg-config
14 BuildRequires:  readline-devel
15
16 %description
17 Lua is a programming language originally designed for extending
18 applications, but also frequently used as a general-purpose,
19 stand-alone language.
20
21 Lua combines simple procedural syntax (similar to Pascal) with powerful
22 data description constructs based on associative arrays and extensible
23 semantics. Lua is dynamically typed, interpreted from byte codes, and
24 has automatic memory management, making it ideal for configuration,
25 scripting, and rapid prototyping. Lua is implemented as a small library
26 of C functions, written in ANSI C, and the implementation goals are
27 simplicity, efficiency, portability, and low embedding cost.
28
29 %package devel
30 Summary:        Development files for lua
31 Group:          Development/Libraries
32 Requires:       %{name} = %{version}
33
34 %description devel
35 Lua is a programming language originally designed for extending
36 applications, but also frequently used as a general-purpose,
37 stand-alone language.
38
39 This package contains files needed for embedding lua into your
40 application.
41
42 %package -n liblua
43 Summary:        Small Embeddable Language with Simple Procedural Syntax
44 Group:          Base/Libraries
45
46 %description -n liblua
47 Lua is a programming language originally designed for extending
48 applications, but also frequently used as a general-purpose,
49 stand-alone language.
50
51 Lua combines simple procedural syntax (similar to Pascal) with powerful
52 data description constructs based on associative arrays and extensible
53 semantics. Lua is dynamically typed, interpreted from byte codes, and
54 has automatic memory management, making it ideal for configuration,
55 scripting, and rapid prototyping. Lua is implemented as a small library
56 of C functions, written in ANSI C, and the implementation goals are
57 simplicity, efficiency, portability, and low embedding cost.
58
59 %package doc
60 Summary:        Small Embeddable Language with Simple Procedural Syntax
61 Group:          Documentation
62 BuildArch:      noarch
63
64 %description doc
65 Lua is a programming language originally designed for extending
66 applications, but also frequently used as a general-purpose,
67 stand-alone language.
68
69 Lua combines simple procedural syntax (similar to Pascal) with powerful
70 data description constructs based on associative arrays and extensible
71 semantics. Lua is dynamically typed, interpreted from byte codes, and
72 has automatic memory management, making it ideal for configuration,
73 scripting, and rapid prototyping. Lua is implemented as a small library
74 of C functions, written in ANSI C, and the implementation goals are
75 simplicity, efficiency, portability, and low embedding cost.
76
77 %prep
78 %setup -q -n lua-%{version}
79 cp %{SOURCE1001} .
80
81 %build
82 export CFLAGS+=" -fPIC -DLUA_USE_LINUX"
83 export LDFLAGS+=" -Wl,-z,relro -Wl,-E -ldl -lreadline -lhistory -lncurses"
84 sed -i -e "s@/usr/local/@/usr/@g" src/luaconf.h
85 %{__make} %{?_smp_mflags} -C src CC="%{__cc}" MYCFLAGS="$CFLAGS" MYLIBS="$LDFLAGS" V=%{major_version} all
86
87 %check
88 %{__make} test || exit 0
89
90 %install
91 make install INSTALL_TOP="%{buildroot}%{_prefix}" INSTALL_LIB="%{buildroot}%{_libdir}" INSTALL_CMOD=%{buildroot}%{_libdir}/lua/%{major_version} INSTALL_MAN="%{buildroot}%{_mandir}/man1"
92 install -D -m644 etc/lua.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
93 for file in lua luac ; do
94     mv "%{buildroot}%{_bindir}/${file}"        "%{buildroot}%{_bindir}/${file}%{major_version}"
95     mv "%{buildroot}%{_mandir}/man1/${file}.1" "%{buildroot}%{_mandir}/man1/${file}%{major_version}.1"
96 done
97 install -d -m 0755 %{buildroot}%{_libdir}/lua/%{major_version}
98 install -d -m 0755 %{buildroot}%{_datadir}/lua/%{major_version}
99 install -D -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.lua
100
101 chmod +x %{buildroot}/%{_libdir}/liblua.so.%{major_version}
102
103 ln -s lua%{major_version} %{buildroot}%{_bindir}/lua
104
105 %post -n liblua -p /sbin/ldconfig
106
107 %postun -n liblua -p /sbin/ldconfig
108
109 %files
110 %manifest %{name}.manifest
111 %defattr(-,root,root)
112 %license COPYRIGHT
113 %{_bindir}/lua
114 %{_bindir}/lua%{major_version}
115 %{_bindir}/luac%{major_version}
116 %dir %{_libdir}/lua
117 %dir %{_libdir}/lua/%{major_version}
118 %dir %{_datadir}/lua
119 %dir %{_datadir}/lua/%{major_version}
120 %{_sysconfdir}/rpm/macros.lua
121
122 %files -n liblua
123 %manifest %{name}.manifest
124 %defattr(-,root,root)
125 %license COPYRIGHT
126 %{_libdir}/liblua.so.%{major_version}
127
128 %files devel
129 %manifest %{name}.manifest
130 %defattr(-,root,root)
131 %{_includedir}/lauxlib.h
132 %{_includedir}/lua.h
133 %{_includedir}/lua.hpp
134 %{_includedir}/luaconf.h
135 %{_includedir}/lualib.h
136 %{_libdir}/pkgconfig/lua.pc
137 %{_libdir}/liblua.a
138 %{_libdir}/liblua.so
139
140 %files doc
141 %manifest %{name}.manifest
142 %defattr(-,root,root)
143 %doc doc/*
144
145 %changelog