Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 1532916b7ffa8694a5a2d0c59412f356 > files > 2

asterisk-app_backticks-0.1-1mdk.src.rpm

Summary:	app_backticks module for the Asterisk PBX
Name:		asterisk-app_backticks
Version:	0.1
Release:	%mkrel 1
License:	GPL
Group:		System/Servers
URL:		http://www.pbxfreeware.org/
Source0:	http://www.pbxfreeware.org/app_backticks.c.bz2
BuildRequires:	asterisk-devel
Requires:	asterisk
Buildroot:	%{_tmppath}/%{name}-%{version}

%description
Execute a shell command and save the result as a variable.

app_backticks lets you execute a shell command and capture its
output like backticks do in most languages. It is available as
both a function and an app.

%prep

%setup -q -T -c %{name}-%{version}
bzcat %{SOURCE0} > app_backticks.c

cat > Makefile << EOF

CFLAGS+=-Wall -D_REENTRANT -D_GNU_SOURCE -fPIC
CC=gcc

all: app_backticks.so

clean:
	rm -f *.so *.o

%.so : %.o
	\$(CC) \$(CFLAGS) -shared -Xlinker -x -o \$@ \$<

app_backticks.so: app_backticks.o
	\$(CC) \$(CFLAGS) -shared -Xlinker -x -o \$@ app_backticks.o -lc
EOF

%build

%make CFLAGS="%{optflags} -pipe -Wall -fPIC -DPIC -D_REENTRANT -D_GNU_SOURCE"

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_libdir}/asterisk
install -m0755 app_backticks.so %{buildroot}%{_libdir}/asterisk/

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/asterisk/app_backticks.so

%changelog
* Sun Feb 19 2006 Oden Eriksson <oeriksson@mandriva.com> 0.1-1mdk
- initial Mandriva package