# Tanım: iptables ayarlamaları için güçlü bir arayüz uygulaması
# URL: http://www.vuurmuur.org
# Paketçi: milisarge
# Gerekler: libnetfilter_log iptables libjpeg-turbo 

isim=vuurmuur
_isim=Vuurmuur
surum=0.8rc2
devir=1
kaynak=(ftp://ftp.vuurmuur.org/releases/$surum/$_name-$surum.tar.gz)

derle() {


	cd Vuurmuur-$surum
	chown -R root:root .
	for file in libvuurmuur vuurmuur vuurmuur_conf ; do
	  tar xfvz $file-$surum.tar.gz
	done
	chown -R root:root .
	CFLAGS="$SLKCFLAGS" \
	cd libvuurmuur-$surum
	./configure \
	  --prefix=/usr \
	  --sysconfdir=/etc
	make
	mkdir -p $PKG/usr/lib
	( cd src/.libs/
	  for file in libvuurmuur.a libvuurmuur.so.0.6.0 ; do
		cat $file > $PKG/usr/lib/$file
	  done
	)
	#replace "installed=no" "installed=yes" -- $PKG/usr/lib/libvuurmuur.la
	mkdir -p $PKG/usr/include
	( cd src
	#strip --strip-unneeded vuurmuur.h
	cat vuurmuur.h > $PKG/usr/include/vuurmuur.h
	)
	
	cd $PKG/usr/lib
	ln -s libvuurmuur.so.0.6.0 libvuurmuur.so.0
	ln -s libvuurmuur.so.0.6.0 libvuurmuur.so



	cd $SRC/Vuurmuur-$surum/vuurmuur-$surum
	./configure \
	  --prefix=/usr \
	  --sysconfdir=/etc \
	  --with-libvuurmuur-includes=$PKG/usr/include \
	  --with-libvuurmuur-libraries=$PKG/usr/lib
	make
	mkdir -p $PKG/usr/bin
	for file in vuurmuur vuurmuur_log vuurmuur_script ; do
	  ( cd $file
		  strip --strip-unneeded $file
		  cat $file > $PKG/usr/bin/$file
		  chmod 755 $PKG/usr/bin/$file
	  )
	done
	mkdir -p $PKG/etc/rc.d/init.d
	mkdir -p $PKG/etc/logrotate.d
	( cd scripts
	cat rc.vuurmuur > $PKG/etc/rc.d/init.d/vuurmuur
	cat  vuurmuur-logrotate > $PKG/etc/logrotate.d/vuurmuur
	)
	#replace "VUURMUUR_LOCATION=/usr/local/bin" "VUURMUUR_LOCATION=/usr/bin" -- $PKG/etc/rc.d/init.d/vuurmuur
	chmod +x $PKG/etc/rc.d/init.d/vuurmuur

	mkdir -p $PKG/usr/man/ru/man8
	mkdir -p $PKG/usr/man/man8
	( cd man/en
	  for file in vuurmuur.8  vuurmuur_log.8  vuurmuur_script.8 ; do
		cat $file > $PKG/usr/man/man8/$file
	  done
	)
	( cd man/ru
	  for file in vuurmuur.8  vuurmuur_log.8  vuurmuur_script.8 ; do
		cat $file > $PKG/usr/man/ru/man8/$file
	  done
	)
	mkdir -p $PKG/usr/share/vuurmuur/scripts
	( cd scripts
	 cat vuurmuur-config-setup.sh > $PKG/usr/share/vuurmuur/scripts/vuurmuur-config-setup.sh
	 chmod 755 $PKG/usr/share/vuurmuur/scripts/vuurmuur-config-setup.sh
	)
	mkdir -p $PKG/usr/share/vuurmuur/config
	mkdir -p -m 700 $PKG/etc/vuurmuur
	( cd config
	 cat config.conf.sample > $PKG/usr/share/vuurmuur/config/config.conf.sample
	 cat config.conf.sample > $PKG/etc/vuurmuur/config.conf
	 chmod 600 $PKG/etc/vuurmuur/config.conf
	)
	
	mkdir -p $PKG/usr/share/vuurmuur/services
	mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/services
	( cd services ;
	LIST=" cvs    imaps                     pop3   smtp         upnp 
		   dns    irc          msn          pop3s  socks        usermin 
		   ftp    jabber       mysql        pptp   squid-proxy  vnc 
		   http   ldap         news         razor  ssh          webmin 
		   https  lisa         ntp          rdp    syslog       whois 
		   ident               pcanywhere   rsync  telnet       windowsmedia 
		   imap                ping         samba  traceroute"
	 for file in $LIST ; do
		cat $file > $PKG/usr/share/vuurmuur/services/$file 
		cat $file > $PKG/etc/vuurmuur/textdir/services/$file 
		chmod 600 $PKG/etc/vuurmuur/textdir/services/$file
	  done
	)



	cd $SRC/Vuurmuur-$surum/vuurmuur_conf-$surum
	./configure \
	  --prefix=/usr \
	  --sysconfdir=/etc \
	  --with-libvuurmuur-includes=$PKG/usr/include \
	  --with-libvuurmuur-libraries=$PKG/usr/lib
	make
	mkdir -p $PKG/usr/bin
	( cd src
	cat vuurmuur_conf > $PKG/usr/bin/vuurmuur_conf
	chmod 755 $PKG/usr/bin/vuurmuur_conf
	)
	( cd po
	  for lang in de fr nb nl no ru en@boldquot pt_BR en@quot ; do
		mkdir -p $PKG/usr/share/locale/$lang/LC_MESSAGES
		cat $lang.gmo > $PKG/usr/share/locale/$lang/LC_MESSAGES/vuurmuur_conf.mo
	  done
	)
	mkdir -p $PKG/usr/share/vuurmuur/help
	( cd help
	  for file in vuurmuur-fr.hlp vuurmuur-ru.UTF-8.hlp vuurmuur-ru.hlp vuurmuur.hlp ; do
		cat $file > $PKG/usr/share/vuurmuur/help/$file
	  done
	)
	( cd man/en
	  for file in vuurmuur_conf.8 ; do
		cat $file > $PKG/usr/man/man8/$file
	  done
	)
	( cd man/ru
	  for file in vuurmuur_conf.8  ; do
		cat $file > $PKG/usr/man/ru/man8/$file
	  done
	)
	mkdir -p $PKG/usr/share/vuurmuur/scripts
	( cd scripts
	  cat vuurmuur-searchlog.sh > $PKG/usr/share/vuurmuur/scripts/vuurmuur-searchlog.sh
	  chmod 755 $PKG/usr/share/vuurmuur/scripts/vuurmuur-searchlog.sh
	)
	mkdir -p $PKG/usr/share/vuurmuur/config
	mkdir -p -m 700 $PKG/etc/vuurmuur
	( cd config
	  cat vuurmuur_conf.conf.sample > $PKG/usr/share/vuurmuur/config/vuurmuur_conf.conf.sample
	  cat vuurmuur_conf.conf.sample > $PKG/etc/vuurmuur/vuurmuur_conf.conf
	)


	cd $SRC/Vuurmuur-$surum/installer/zones
	( for zone in dmz inet lan vpn ; do
		mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/zones/$zone/networks
		cat $SRC/Vuurmuur-$surum/installer/zones/$zone/zone.config > $PKG/etc/vuurmuur/textdir/zones/$zone/zone.config
	  done
	)
	mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/zones/inet/networks/internet/groups
	mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/zones/inet/networks/internet/hosts
	cat $SRC/Vuurmuur-$surum/installer/zones/inet/networks/internet/network.config > $PKG/etc/vuurmuur/textdir/zones/inet/networks/internet/network.config
	mkdir -p -m 700 $PKG/etc/vuurmuur/plugins
	touch $PKG/etc/vuurmuur/plugins/textdir.conf
	chmod 600 $PKG/etc/vuurmuur/plugins/textdir.conf
	echo "LOCATION=\"/etc/vuurmuur/textdir\"" > $PKG/etc/vuurmuur/plugins/textdir.conf
	mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/zones
	mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/interfaces
	mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/rules

}
