

make clean
make 
make install DESTDIR=$PKG LIBSUFFIX=$LIBDIRSUFFIX

mkdir $PKG/usr/bin
cp $CWD/pkexec-netpkg $PKG/usr/bin/netpkg
chmod 755 $PKG/usr/bin/netpkg

# Policykit
mkdir -p $PKG/usr/share/polkit-1/actions
cat << EOS > $PKG/usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.netpkg.policy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
  
  <action id="org.freedesktop.policykit.pkexec.run-netpkg">
  <description>Run $NAME</description>
  <message>Authentication is required to run netpkg as Root</message>
  <defaults>
  <allow_any>no</allow_any>
  <allow_inactive>no</allow_inactive>
  <allow_active>yes</allow_active>
  </defaults>
  <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/netpkg</annotate>
  <annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
  </action>

</policyconfig>
EOS
