Rebase for lua 5.3.3
[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 LDFLAGS+=" -Wl,-E -ldl -lreadline -lhistory -lncurses"
83 sed -i 's:LUA_ROOT2 "LIBDIR/lua/%{major_version}/":LUA_ROOT2 \"%{_lib}/lua/%{major_version}/":' src/luaconf.h
84 make %{?_smp_mflags} -C src CC="%{__cc}" MYCFLAGS="%{optflags} -fPIC -DLUA_USE_LINUX" MYLIBS="$LDFLAGS" V=%{major_version} all
85
86 %install
87 make install INSTALL_TOP="%{buildroot}%{_prefix}" INSTALL_LIB="%{buildroot}%{_libdir}" INSTALL_CMOD=%{buildroot}%{_libdir}/lua/%{major_version} INSTALL_MAN="%{buildroot}%{_mandir}/man1"
88 install -D -m644 etc/lua.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
89 for file in lua luac ; do
90     mv "%{buildroot}%{_bindir}/${file}"        "%{buildroot}%{_bindir}/${file}%{major_version}"
91     mv "%{buildroot}%{_mandir}/man1/${file}.1" "%{buildroot}%{_mandir}/man1/${file}%{major_version}.1"
92 done
93 install -d -m 0755 %{buildroot}%{_libdir}/lua/%{major_version}
94 install -d -m 0755 %{buildroot}%{_datadir}/lua/%{major_version}
95 install -D -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.lua
96
97 chmod +x %{buildroot}/%{_libdir}/liblua.so.%{major_version}
98
99 ln -s lua%{major_version} %{buildroot}%{_bindir}/lua
100
101 %post -n liblua -p /sbin/ldconfig
102
103 %postun -n liblua -p /sbin/ldconfig
104
105 %files
106 %manifest %{name}.manifest
107 %defattr(-,root,root)
108 %{_mandir}/man1/lua%{major_version}.1*
109 %{_mandir}/man1/luac%{major_version}.1*
110 %{_bindir}/lua
111 %{_bindir}/lua%{major_version}
112 %{_bindir}/luac%{major_version}
113 %dir %{_libdir}/lua
114 %dir %{_libdir}/lua/%{major_version}
115 %dir %{_datadir}/lua
116 %dir %{_datadir}/lua/%{major_version}
117 %{_sysconfdir}/rpm/macros.lua
118
119 %files -n liblua
120 %manifest %{name}.manifest
121 %defattr(-,root,root)
122 %license COPYRIGHT
123 %{_libdir}/liblua.so.%{major_version}
124
125 %files devel
126 %manifest %{name}.manifest
127 %defattr(-,root,root)
128 %{_includedir}/lauxlib.h
129 %{_includedir}/lua.h
130 %{_includedir}/lua.hpp
131 %{_includedir}/luaconf.h
132 %{_includedir}/lualib.h
133 %{_libdir}/pkgconfig/lua.pc
134 %{_libdir}/liblua.a
135 %{_libdir}/liblua.so
136
137 %files doc
138 %manifest %{name}.manifest
139 %defattr(-,root,root)
140 %doc doc/*
141
142 %changelog