code:
diff -up wpa_supplicant-0.7.3/src/crypto/tls_openssl.c.more-openssl-algs wpa_supplicant-0.7.3/src/crypto/tls_openssl.c
--- wpa_supplicant-0.7.3/src/crypto/tls_openssl.c.more-openssl-algs	2010-09-07 10:43:39.000000000 -0500
+++ wpa_supplicant-0.7.3/src/crypto/tls_openssl.c	2010-12-08 10:01:02.967664004 -0600
@@ -710,6 +710,11 @@ void * tls_init(const struct tls_config
 #endif /* OPENSSL_FIPS */
 #endif /* CONFIG_FIPS */
 		SSL_load_error_strings();
+		/* Only add potentially weak hashes and encryption algorithms
+		 * when FIPS mode is not enabled.
+		 */
+		if (!conf || !conf->fips_mode)
+			OpenSSL_add_all_algorithms();
 		SSL_library_init();
 #ifndef OPENSSL_NO_SHA256
 		EVP_add_digest(EVP_sha256());


code:
diff -up wpa_supplicant-0.6.7/wpa_supplicant/events.c.scan-results-msg wpa_supplicant-0.6.7/wpa_supplicant/events.c
--- wpa_supplicant-0.6.7/wpa_supplicant/events.c.scan-results-msg 2009-01-30 12:08:34.000000000 -0500
+++ wpa_supplicant-0.6.7/wpa_supplicant/events.c	2009-01-30 12:08:37.000000000 -0500
@@ -911,7 +911,7 @@ static void wpa_supplicant_event_scan_re
 	}

 	wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available");
-	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
+	wpa_msg_ctrl(wpa_s, MSG_DEBUG, WPA_EVENT_SCAN_RESULTS);
 	wpas_notify_scan_results(wpa_s);

 	wpas_notify_scan_done(wpa_s, 1);

repo_name: ayhanyalcinsoy/main


code:
diff -p -up wpa_supplicant-0.6.3/wpa_supplicant/config_ssid.h.WEP232 wpa_supplicant-0.6.3/wpa_supplicant/config_ssid.h
--- wpa_supplicant-0.6.3/wpa_supplicant/config_ssid.h.WEP232	2008-02-23 03:45:24.000000000 +0100
+++ wpa_supplicant-0.6.3/wpa_supplicant/config_ssid.h	2008-03-31 22:28:29.000000000 +0200
@@ -189,7 +189,7 @@ struct wpa_ssid {
 #endif /* IEEE8021X_EAPOL */

 #define NUM_WEP_KEYS 4
-#define MAX_WEP_KEY_LEN 16
+#define MAX_WEP_KEY_LEN 32
 	/**
 	 * wep_key - WEP keys
 	 */


code:
Index: src/drivers/driver_wext.c
===================================================================
--- src/drivers/driver_wext.c.orig
+++ src/drivers/driver_wext.c
@@ -1901,19 +1901,26 @@ int wpa_driver_wext_associate(void *priv
 	 * SIOCSIWENCODE here.
 	 */
 	if (drv->auth_alg_fallback &&
-	    wpa_driver_wext_auth_alg_fallback(drv, params) < 0)
+	    wpa_driver_wext_auth_alg_fallback(drv, params) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because auth_alg_fallback failed", __FUNCTION__);
 		ret = -1;
+	}

 	if (!params->bssid &&
-	    wpa_driver_wext_set_bssid(drv, NULL) < 0)
+	    wpa_driver_wext_set_bssid(drv, NULL) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_bssid failed", __FUNCTION__);
 		ret = -1;
+	}

 	/* TODO: should consider getting wpa version and cipher/key_mgmt suites
 	 * from configuration, not from here, where only the selected suite is
 	 * available */
 	if (wpa_driver_wext_set_gen_ie(drv, params->wpa_ie, params->wpa_ie_len)
-	    < 0)
+	    < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_gen_ie failed", __FUNCTION__);
 		ret = -1;
+	}
+
 	if (params->wpa_ie == NULL || params->wpa_ie_len == 0)
 		value = IW_AUTH_WPA_VERSION_DISABLED;
 	else if (params->wpa_ie[0] == WLAN_EID_RSN)
@@ -1921,27 +1928,41 @@ int wpa_driver_wext_associate(void *priv
 	else
 		value = IW_AUTH_WPA_VERSION_WPA;
 	if (wpa_driver_wext_set_auth_param(drv,
-					   IW_AUTH_WPA_VERSION, value) < 0)
+					   IW_AUTH_WPA_VERSION, value) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_auth_param(WPA_VERSION) failed", __FUNCTION__);
 		ret = -1;
+	}
+
 	value = wpa_driver_wext_cipher2wext(params->pairwise_suite);
 	if (wpa_driver_wext_set_auth_param(drv,
-					   IW_AUTH_CIPHER_PAIRWISE, value) < 0)
+					   IW_AUTH_CIPHER_PAIRWISE, value) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_auth_param(CIPHER_PAIRWISE) failed", __FUNCTION__);
 		ret = -1;
+	}
+
 	value = wpa_driver_wext_cipher2wext(params->group_suite);
 	if (wpa_driver_wext_set_auth_param(drv,
-					   IW_AUTH_CIPHER_GROUP, value) < 0)
+					   IW_AUTH_CIPHER_GROUP, value) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_auth_param(CIPHER_GROUP) failed", __FUNCTION__);
 		ret = -1;
+	}
+
 	value = wpa_driver_wext_keymgmt2wext(params->key_mgmt_suite);
 	if (wpa_driver_wext_set_auth_param(drv,
-					   IW_AUTH_KEY_MGMT, value) < 0)
+					   IW_AUTH_KEY_MGMT, value) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_auth_param(KEY_MGMT) failed", __FUNCTION__);
 		ret = -1;
+	}
+
 	value = params->key_mgmt_suite != KEY_MGMT_NONE ||
 		params->pairwise_suite != CIPHER_NONE ||
 		params->group_suite != CIPHER_NONE ||
 		params->wpa_ie_len;
 	if (wpa_driver_wext_set_auth_param(drv,
-					   IW_AUTH_PRIVACY_INVOKED, value) < 0)
+					   IW_AUTH_PRIVACY_INVOKED, value) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_auth_param(PRIVACY_INVOKED) failed", __FUNCTION__);
 		ret = -1;
+	}

 	/* Allow unencrypted EAPOL messages even if pairwise keys are set when
 	 * not using WPA. IEEE 802.1X specifies that these frames are not
@@ -1952,12 +1973,18 @@ int wpa_driver_wext_associate(void *priv
 	else
 		allow_unencrypted_eapol = 1;

-	if (wpa_driver_wext_set_psk(drv, params->psk) < 0)
+	if (wpa_driver_wext_set_psk(drv, params->psk) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_psk failed", __FUNCTION__);
 		ret = -1;
+	}
+
 	if (wpa_driver_wext_set_auth_param(drv,
 					   IW_AUTH_RX_UNENCRYPTED_EAPOL,
-					   allow_unencrypted_eapol) < 0)
+					   allow_unencrypted_eapol) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_auth_param(RX_UNENCRYPTED_EAPOL) failed", __FUNCTION__);
 		ret = -1;
+	}
+
 #ifdef CONFIG_IEEE80211W
 	switch (params->mgmt_frame_protection) {
 	case NO_MGMT_FRAME_PROTECTION:
@@ -1970,17 +1997,25 @@ int wpa_driver_wext_associate(void *priv
 		value = IW_AUTH_MFP_REQUIRED;
 		break;
 	};
-	if (wpa_driver_wext_set_auth_param(drv, IW_AUTH_MFP, value) < 0)
+	if (wpa_driver_wext_set_auth_param(drv, IW_AUTH_MFP, value) < 0) {
+	        wpa_printf(MSG_DEBUG, "%s: assoc failed because set_auth_param(IW_AUTH_MFP) failed", __FUNCTION__);
 		ret = -1;
+	}
 #endif /* CONFIG_IEEE80211W */
-	if (params->freq && wpa_driver_wext_set_freq(drv, params->freq) < 0)
+	if (params->freq && wpa_driver_wext_set_freq(drv, params->freq) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_freq failed", __FUNCTION__);
 		ret = -1;
+	}
 	if (!drv->cfg80211 &&
-	    wpa_driver_wext_set_ssid(drv, params->ssid, params->ssid_len) < 0)
+	    wpa_driver_wext_set_ssid(drv, params->ssid, params->ssid_len) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_ssid failed", __FUNCTION__);
 		ret = -1;
+	}
 	if (params->bssid &&
-	    wpa_driver_wext_set_bssid(drv, params->bssid) < 0)
+	    wpa_driver_wext_set_bssid(drv, params->bssid) < 0) {
+		wpa_printf(MSG_DEBUG, "%s: assoc failed because set_bssid failed", __FUNCTION__);
 		ret = -1;
+	}
 	if (drv->cfg80211 &&
 	    wpa_driver_wext_set_ssid(drv, params->ssid, params->ssid_len) < 0)
 		ret = -1;
@@ -2008,6 +2043,10 @@ static int wpa_driver_wext_set_auth_alg(
 	res = wpa_driver_wext_set_auth_param(drv, IW_AUTH_80211_AUTH_ALG,
 					     algs);
 	drv->auth_alg_fallback = res == -2;
+
+	if (res == -2)
+		wpa_printf(MSG_DEBUG, "%s: falling back to ENCODE for AUTH", __FUNCTION__);
+
 	return res;
 }


code:
Index: src/drivers/driver_wext.c
===================================================================
--- src/drivers/driver_wext.c.orig
+++ src/drivers/driver_wext.c
@@ -54,12 +54,13 @@ int wpa_driver_wext_set_auth_param(struc
 	iwr.u.param.value = value;

 	if (ioctl(drv->ioctl_sock, SIOCSIWAUTH, &iwr) < 0) {
+		int saved_errno = errno;
 		if (errno != EOPNOTSUPP) {
 			wpa_printf(MSG_DEBUG, "WEXT: SIOCSIWAUTH(param %d "
 				   "value 0x%x) failed: %s)",
 				   idx, value, strerror(errno));
 		}
-		ret = errno == EOPNOTSUPP ? -2 : -1;
+		ret = saved_errno == EOPNOTSUPP ? -2 : -1;
 	}

 	return ret;


code:
From: Reinhard Tartler <siretart@tauware.de>
References: none
Description: Use pkg-config for libpcsclite linkage flags
 At least in debian, we can rely on pkg-config being available and
 returning more accurate ldflags.

--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -691,7 +691,7 @@ ifdef CONFIG_NATIVE_WINDOWS
 #dynamic symbol loading that is now used in pcsc_funcs.c
 #LIBS += -lwinscard
 else
-LIBS += -lpcsclite -lpthread
+LIBS += $(shell pkg-config --libs libpcsclite)
 endif
 endif


code:
diff -aurp a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
--- a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in	2012-05-15 09:00:03.048545044 +0000
+++ b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in	2012-05-15 09:01:19.759550509 +0000
@@ -1,5 +1,5 @@
 [D-BUS Service]
 Name=fi.epitest.hostap.WPASupplicant
-Exec=@BINDIR@/wpa_supplicant -u
+Exec=/usr/sbin/wpa_supplicant -u
 User=root
 SystemdService=wpa_supplicant.service
diff -aurp a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
--- a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in	2012-05-15 09:00:03.048545044 +0000
+++ b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in	2012-05-15 09:01:28.727551913 +0000
@@ -1,5 +1,5 @@
 [D-BUS Service]
 Name=fi.w1.wpa_supplicant1
-Exec=@BINDIR@/wpa_supplicant -u
+Exec=/usr/sbin/wpa_supplicant -u
 User=root
 SystemdService=wpa_supplicant.service


code:
diff -aurp a/wpa_supplicant/dbus/dbus_new_helpers.c b/wpa_supplicant/dbus/dbus_new_helpers.c
--- a/wpa_supplicant/dbus/dbus_new_helpers.c	2012-05-15 07:28:37.616150164 +0000
+++ b/wpa_supplicant/dbus/dbus_new_helpers.c	2012-05-15 07:30:21.904157611 +0000
@@ -882,7 +882,7 @@ void wpa_dbus_mark_property_changed(stru
 	const struct wpa_dbus_property_desc *dsc;
 	int i = 0;

-	if (iface == NULL)
+	if (iface == NULL || path == NULL)
 		return;

 	dbus_connection_get_object_path_data(iface->con, path,
diff -aurp a/wpa_supplicant/dbus/dbus_old.c b/wpa_supplicant/dbus/dbus_old.c
--- a/wpa_supplicant/dbus/dbus_old.c	2012-05-15 07:28:29.502149373 +0000
+++ b/wpa_supplicant/dbus/dbus_old.c	2012-05-15 07:30:48.859162441 +0000
@@ -379,7 +379,7 @@ void wpa_supplicant_dbus_notify_scan_res
 	DBusMessage *_signal;

 	/* Do nothing if the control interface is not turned on */
-	if (iface == NULL)
+	if (iface == NULL || wpa_s->dbus_path == NULL)
 		return;

 	_signal = dbus_message_new_signal(wpa_s->dbus_path,
@@ -419,7 +419,7 @@ void wpa_supplicant_dbus_notify_state_ch
 	if (wpa_s->global == NULL)
 		return;
 	iface = wpa_s->global->dbus;
-	if (iface == NULL)
+	if (iface == NULL || wpa_s->dbus_path == NULL)
 		return;

 	/* Only send signal if state really changed */
@@ -478,7 +478,7 @@ void wpa_supplicant_dbus_notify_scanning
 	dbus_bool_t scanning = wpa_s->scanning ? TRUE : FALSE;

 	/* Do nothing if the control interface is not turned on */
-	if (iface == NULL)
+	if (iface == NULL || wpa_s->dbus_path == NULL)
 		return;

 	_signal = dbus_message_new_signal(wpa_s->dbus_path,
@@ -513,7 +513,7 @@ void wpa_supplicant_dbus_notify_wps_cred
 	if (wpa_s->global == NULL)
 		return;
 	iface = wpa_s->global->dbus;
-	if (iface == NULL)
+	if (iface == NULL || wpa_s->dbus_path == NULL)
 		return;

 	_signal = dbus_message_new_signal(wpa_s->dbus_path,
@@ -564,7 +564,7 @@ void wpa_supplicant_dbus_notify_certific
 	if (wpa_s->global == NULL)
 		return;
 	iface = wpa_s->global->dbus;
-	if (iface == NULL)
+	if (iface == NULL || wpa_s->dbus_path == NULL)
 		return;

 	_signal = dbus_message_new_signal(wpa_s->dbus_path,


code:
diff -Naurp a/src/eap_peer/eap_methods.c b/src/eap_peer/eap_methods.c
--- a/src/eap_peer/eap_methods.c	2012-05-15 08:23:17.151386999 +0000
+++ b/src/eap_peer/eap_methods.c	2012-05-15 08:23:57.403389760 +0000
@@ -342,6 +342,120 @@ int eap_peer_method_register(struct eap_

 /**
+ * eap_peer_register_methods - Register all known EAP peer methods
+ *
+ * This function is called at program start to register all compiled
+ * in EAP peer methods.
+ */
+int eap_peer_register_methods(void)
+{
+	int ret = 0;
+
+#ifdef EAP_MD5
+	if (ret == 0)
+		ret = eap_peer_md5_register();
+#endif /* EAP_MD5 */
+
+#ifdef EAP_TLS
+	if (ret == 0)
+		ret = eap_peer_tls_register();
+#endif /* EAP_TLS */
+
+#ifdef EAP_MSCHAPv2
+	if (ret == 0)
+		ret = eap_peer_mschapv2_register();
+#endif /* EAP_MSCHAPv2 */
+
+#ifdef EAP_PEAP
+	if (ret == 0)
+		ret = eap_peer_peap_register();
+#endif /* EAP_PEAP */
+
+#ifdef EAP_TTLS
+	if (ret == 0)
+		ret = eap_peer_ttls_register();
+#endif /* EAP_TTLS */
+
+#ifdef EAP_GTC
+	if (ret == 0)
+		ret = eap_peer_gtc_register();
+#endif /* EAP_GTC */
+
+#ifdef EAP_OTP
+	if (ret == 0)
+		ret = eap_peer_otp_register();
+#endif /* EAP_OTP */
+
+#ifdef EAP_SIM
+	if (ret == 0)
+		ret = eap_peer_sim_register();
+#endif /* EAP_SIM */
+
+#ifdef EAP_LEAP
+	if (ret == 0)
+		ret = eap_peer_leap_register();
+#endif /* EAP_LEAP */
+
+#ifdef EAP_PSK
+	if (ret == 0)
+		ret = eap_peer_psk_register();
+#endif /* EAP_PSK */
+
+#ifdef EAP_AKA
+	if (ret == 0)
+		ret = eap_peer_aka_register();
+#endif /* EAP_AKA */
+
+#ifdef EAP_AKA_PRIME
+	if (ret == 0)
+		ret = eap_peer_aka_prime_register();
+#endif /* EAP_AKA_PRIME */
+
+#ifdef EAP_FAST
+	if (ret == 0)
+		ret = eap_peer_fast_register();
+#endif /* EAP_FAST */
+
+#ifdef EAP_PAX
+	if (ret == 0)
+		ret = eap_peer_pax_register();
+#endif /* EAP_PAX */
+
+#ifdef EAP_SAKE
+	if (ret == 0)
+		ret = eap_peer_sake_register();
+#endif /* EAP_SAKE */
+
+#ifdef EAP_GPSK
+	if (ret == 0)
+		ret = eap_peer_gpsk_register();
+#endif /* EAP_GPSK */
+
+#ifdef EAP_WSC
+	if (ret == 0)
+		ret = eap_peer_wsc_register();
+#endif /* EAP_WSC */
+
+#ifdef EAP_IKEV2
+	if (ret == 0)
+		ret = eap_peer_ikev2_register();
+#endif /* EAP_IKEV2 */
+
+#ifdef EAP_VENDOR_TEST
+	if (ret == 0)
+		ret = eap_peer_vendor_test_register();
+#endif /* EAP_VENDOR_TEST */
+
+#ifdef EAP_TNC
+	if (ret == 0)
+		ret = eap_peer_tnc_register();
+#endif /* EAP_TNC */
+
+	return ret;
+}
+
+
+/**
  * eap_peer_unregister_methods - Unregister EAP peer methods
  *
  * This function is called at program termination to unregister all EAP peer
diff -Naurp a/src/eap_peer/eap_methods.h b/src/eap_peer/eap_methods.h
--- a/src/eap_peer/eap_methods.h	2012-05-15 08:23:17.151386999 +0000
+++ b/src/eap_peer/eap_methods.h	2012-05-15 08:23:57.404389735 +0000
@@ -32,6 +32,7 @@ EapType eap_peer_get_type(const char *na
 const char * eap_get_name(int vendor, EapType type);
 size_t eap_get_names(char *buf, size_t buflen);
 char ** eap_get_names_as_string_array(size_t *num);
+int eap_peer_register_methods(void);
 void eap_peer_unregister_methods(void);

 #else /* IEEE8021X_EAPOL */
diff -Naurp a/src/eap_peer/libeap0.pc b/src/eap_peer/libeap0.pc
--- a/src/eap_peer/libeap0.pc	1970-01-01 00:00:00.000000000 +0000
+++ b/src/eap_peer/libeap0.pc	2012-05-15 08:23:57.404389735 +0000
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/eap_peer
+
+Name: libeap0
+Description: EAP Peer Library API
+Version: 0.7.2
+Libs: -L${libdir} -leap
+Cflags: -I${includedir}
diff -Naurp a/src/eap_peer/Makefile b/src/eap_peer/Makefile
--- a/src/eap_peer/Makefile	2012-05-15 08:23:17.152386964 +0000
+++ b/src/eap_peer/Makefile	2012-05-15 08:23:57.403389760 +0000
@@ -1,11 +1,186 @@
-all:
-	@echo Nothing to be made.
+LIBEAP_NAME = libeap
+LIBEAP_CURRENT = 0
+LIBEAP_REVISION = 0
+LIBEAP_AGE = 0
+
+LIBEAP = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT).$(LIBEAP_REVISION).$(LIBEAP_AGE)
+LIBEAP_SO = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT)
+
+.PHONY: all clean install uninstall
+
+all: $(LIBEAP)
+
+ifndef CC
+CC=gcc
+endif
+
+ifndef CFLAGS
+CFLAGS = -MMD -O0 -Wall -g
+endif
+
+CONFIG_TLS=openssl
+
+INCLUDE_INSTALL_DIR=/usr/include/eap_peer
+
+# Got to use override all across the board, otherwise a 'make
+# CFLAGS=XX' will kill us because the command line's CFLAGS will
+# overwrite Make's and we'll loose all the infrastructure it sets.
+override CFLAGS += -I. -I.. -I../crypto -I../utils -I../common
+
+# at least for now, need to include config_ssid.h and config_blob.h from
+# wpa_supplicant directory
+override CFLAGS += -I ../../wpa_supplicant
+
+OBJS_both += ../utils/common.o
+OBJS_both += ../utils/os_unix.o
+OBJS_both += ../utils/wpa_debug.o
+OBJS_both += ../utils/base64.o
+OBJS_both += ../utils/wpabuf.o
+OBJS_both += ../crypto/md5.o
+OBJS_both += ../crypto/sha1.o
+OBJS_both += ../crypto/sha1-tlsprf.o
+OBJS_both += ../crypto/aes-encblock.o
+OBJS_both += ../crypto/aes-wrap.o
+OBJS_both += ../crypto/aes-ctr.o
+OBJS_both += ../crypto/aes-eax.o
+OBJS_both += ../crypto/aes-omac1.o
+OBJS_both += ../crypto/ms_funcs.o
+OBJS_both += ../crypto/sha256.o
+
+
+OBJS_both += ../eap_common/eap_peap_common.o
+OBJS_both += ../eap_common/eap_psk_common.o
+OBJS_both += ../eap_common/eap_pax_common.o
+OBJS_both += ../eap_common/eap_sake_common.o
+OBJS_both += ../eap_common/eap_gpsk_common.o
+OBJS_both += ../eap_common/chap.o
+
+OBJS_peer += ../eap_peer/eap_tls.o
+OBJS_peer += ../eap_peer/eap_peap.o
+OBJS_peer += ../eap_peer/eap_ttls.o
+OBJS_peer += ../eap_peer/eap_md5.o
+OBJS_peer += ../eap_peer/eap_mschapv2.o
+OBJS_peer += ../eap_peer/mschapv2.o
+OBJS_peer += ../eap_peer/eap_otp.o
+OBJS_peer += ../eap_peer/eap_gtc.o
+OBJS_peer += ../eap_peer/eap_leap.o
+OBJS_peer += ../eap_peer/eap_psk.o
+OBJS_peer += ../eap_peer/eap_pax.o
+OBJS_peer += ../eap_peer/eap_sake.o
+OBJS_peer += ../eap_peer/eap_gpsk.o
+OBJS_peer += ../eap_peer/eap.o
+OBJS_peer += ../eap_common/eap_common.o
+OBJS_peer += ../eap_peer/eap_methods.o
+OBJS_peer += ../eap_peer/eap_tls_common.o
+
+override CFLAGS += -DEAP_TLS
+override CFLAGS += -DEAP_PEAP
+override CFLAGS += -DEAP_TTLS
+override CFLAGS += -DEAP_MD5
+override CFLAGS += -DEAP_MSCHAPv2
+override CFLAGS += -DEAP_GTC
+override CFLAGS += -DEAP_OTP
+override CFLAGS += -DEAP_LEAP
+override CFLAGS += -DEAP_PSK
+override CFLAGS += -DEAP_PAX
+override CFLAGS += -DEAP_SAKE
+override CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256
+override CFLAGS += -DEAP_TLS_FUNCS
+
+override CFLAGS += -DIEEE8021X_EAPOL
+
+ifeq ($(CONFIG_TLS), openssl)
+override CFLAGS += -DEAP_TLS_OPENSSL
+OBJS_both += ../crypto/tls_openssl.o
+OBJS_both += ../crypto/crypto_openssl.o
+LIBS += -lssl -lcrypto
+override CFLAGS += -DINTERNAL_SHA256
+endif
+
+ifeq ($(CONFIG_TLS), internal)
+OBJS_both += ../crypto/tls_internal.o
+OBJS_both += ../tls/tlsv1_common.o ../../tls/tlsv1_record.o
+OBJS_both += ../tls/tlsv1_cred.o
+OBJS_both += ../tls/asn1.o ../../tls/x509v3.o
+OBJS_both += ../crypto/crypto_internal.o ../../tls/rsa.o ../../tls/bignum.o
+
+OBJS_peer += ../tls/tlsv1_client.o
+OBJS_peer += ../tls/tlsv1_client_write.o ../../tls/tlsv1_client_read.o
+override CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
+
+OBJS_server += ../tls/tlsv1_server.o
+OBJS_server += ../tls/tlsv1_server_write.o ../../tls/tlsv1_server_read.o
+override CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
+
+override CFLAGS += -DCONFIG_TLS_INTERNAL
+override CFLAGS += -DCONFIG_CRYPTO_INTERNAL
+override CFLAGS += -DCONFIG_INTERNAL_X509
+override CFLAGS += -DINTERNAL_AES
+override CFLAGS += -DINTERNAL_SHA1
+override CFLAGS += -DINTERNAL_SHA256
+override CFLAGS += -DINTERNAL_MD5
+override CFLAGS += -DINTERNAL_MD4
+override CFLAGS += -DINTERNAL_DES
+ifdef CONFIG_INTERNAL_LIBTOMMATH
+override CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
+else
+LIBS += -ltommath
+endif
+endif
+
+ifndef LDO
+LDO=$(CC)
+endif
+
+
+OBJS_lib=$(OBJS_both) $(OBJS_peer)
+
+ #$(OBJS_server)
+
+override CFLAGS  += -fPIC -DPIC
+LDFLAGS += -shared
+
+$(LIBEAP): $(OBJS_lib)
+	$(LDO) $(LDFLAGS) $(OBJS_lib) -Wl,-soname -Wl,$(LIBEAP_SO) -o $(LIBEAP) $(LIBS)
+
+
+UTIL_HEADERS = ../utils/includes.h ../utils/common.h \
+	../utils/wpabuf.h ../utils/build_config.h \
+	../utils/os.h ../utils/wpa_debug.h
+COMMON_HEADERS = ../common/defs.h
+EAP_COMMON_HEADERS = ../eap_common/eap_defs.h
+MAIN_HEADERS = eap.h eap_methods.h eap_config.h
+CRYPTO_HEADERS =  ../crypto/tls.h
+
+install:
+
+	mkdir -p $(DESTDIR)/usr/lib
+#	copy the lib file to std lib location
+	cp $(LIBEAP) $(DESTDIR)/usr/lib
+	ln -fs $(LIBEAP_SO) $(DESTDIR)/usr/lib/$(LIBEAP_NAME).so
+	ln -fs $(LIBEAP_NAME).so.0.0.0 $(DESTDIR)/usr/lib/$(LIBEAP_NAME).so.0
+
+#	copy the headers reqd by apps using eap peer library in its own subfolder under /usr/include
+	mkdir -p \
+		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common \
+		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common \
+		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util \
+		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto
+	install -m 0644 $(EAP_COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common
+	install -m 0644 $(COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common
+	install -m 0644 $(CRYPTO_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto
+	install -m 0644 $(UTIL_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util
+	install -m 0644 $(MAIN_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/
+
+	mkdir -p $(DESTDIR)/usr/lib/pkgconfig
+	cp libeap0.pc $(DESTDIR)/usr/lib/pkgconfig
+
+uninstall:
+
+	rm $(DESTDIR)/usr/lib/$(LIBEAP)
+	rm -fr $(DESTDIR)/$(INCLUDE_INSTALL_DIR)
+	rm -f $(DESTDIR)/usr/lib/pkgconfig/libeap0.pc

 clean:
-	rm -f *~ *.o *.so *.d
+	rm -f *~ *.o *.so *.d libeap.a $(LIBEAP) $(OBJS_lib)

-install:
-	if ls *.so >/dev/null 2>&1; then \
-		install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \
-		cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \
-	; fi


code:
# wpa_supplicant.conf
# WPA-PSK ile kimlikleme yapılmasını zorunlu kılan kablosuz erişim noktaları ile
# Microsoft IAS Radius sunucu kimliklemesinin wpa_supplicant ile nasıl yapılacağını
# örnekleyen ayar dosyası. İlgili yerleri doldurmanız gerekir.
#
# wpa_supplicant'ın desteklediği diğer ayar işlemleri için:
#  /usr/share/doc/wpasupplicant/wpa_supplicant.conf.example dosyasına bakınız.

# Root'un wpa_cli ile bağlantıyı izlemesi için
ctrl_interface=/run/wpa_supplicant

eapol_version=1
ap_scan=1
fast_reauth=1

# WPA-PSK kimlikleme gerektiren kablosuz erişim noktaları için ayarlar
network={
# Erişim noktasının SSID'si
        ssid="SSID"
# Erişim cihazının WPA parolası
 	psk="Parola1234"
# Bu bağlantının önceliğinin 1. sırada olduğu belirtiliyor
 	priority=1
}

# MS IAS Radius sunucusunda kimlikleme için gereken ayarlar
network={
	ssid="SSID"
	key_mgmt=WPA-EAP
	eap=PEAP
	identity="ALAN_ADI\KULLANICI"
	password="Parola1234"
	phase1="auth=MSCHAPV2"
	priority=2
}


code:
# Use the flag "-i" before each of your interfaces, like so:
#  INTERFACES="-ieth1 -iwlan0"
INTERFACES=""

# Use the flag "-D" before each driver, like so:
#  DRIVERS="-Dwext"
DRIVERS=""

# Other arguments
#   -u   Enable the D-Bus interface (required for use with NetworkManager)
#   -f   Log to /var/log/wpa_supplicant.log
#   -P   Write pid file to /run/wpa_supplicant.pid
#        required to return proper codes by init scripts (e.g. double "start" action)
#        -B to daemonize that has to be used together with -P is already in wpa_supplicant.init.d
OTHER_ARGS="-u -f /var/log/wpa_supplicant.log -P /run/wpa_supplicant.pid"


code:
    CONFIG_CTRL_IFACE=y
    CONFIG_CTRL_IFACE_DBUS=y
    CONFIG_CTRL_IFACE_DBUS_NEW=y
    CONFIG_CTRL_IFACE_DBUS_INTRO=y
    #CONFIG_DRIVER_HOSTAP=y
    #CONFIG_DRIVER_HERMES=y
    #CONFIG_DRIVER_MADWIFI=y
    CONFIG_DRIVER_ATMEL=y
    CONFIG_DRIVER_WEXT=y
    CONFIG_DRIVER_NL80211=y
    CONFIG_DRIVER_NDISWRAPPER=y
    #CONFIG_DRIVER_PRISM54=y
    CONFIG_DRIVER_WIRED=y
    #CONFIG_DRIVER_BROADCOM=y
    #CONFIG_DRIVER_IPW=y
    #CONFIG_DRIVER_BSD=y
    #CONFIG_DRIVER_NDIS=y
    CONFIG_WIRELESS_EXTENSION=y
    CONFIG_IEEE8021X_EAPOL=y
    CONFIG_EAP_MD5=y
    CONFIG_EAP_MSCHAPV2=y
    CONFIG_EAP_TLS=y
    CONFIG_EAP_PEAP=y
    CONFIG_EAP_TTLS=y
    CONFIG_EAP_FAST=y
    CONFIG_EAP_GTC=y
    CONFIG_EAP_OTP=y
    CONFIG_EAP_SIM=y
    CONFIG_EAP_AKA=y
    CONFIG_EAP_PSK=y
    CONFIG_EAP_PAX=y
    CONFIG_EAP_LEAP=y
    #CONFIG_PCSC=y
    CONFIG_EAP_SAKE=y
    CONFIG_EAP_GPSK=y
    CONFIG_EAP_GPSK_SHA256=y
    CONFIG_EAP_TNC=y
    CONFIG_WPS=y
    CONFIG_EAP_IKEV2=y
    CONFIG_PKCS12=y
    CONFIG_SMARTCARD=y
    CONFIG_DEBUG_FILE=y
    CFLAGS += -I/usr/include/libnl3
    CONFIG_IPV6=y
    CONFIG_LIBNL32=y
    CONFIG_PEERKEY=y
    CONFIG_READLINE=y


code:
/var/log/wpa_supplicant.log {
    missingok
    notifempty
    size 30k
    create 0600 root root
}


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import dbus

WPAS_DBUS_OPATH = "/fi/epitest/hostap/WPASupplicant"
WPAS_DBUS_INTERFACES_OPATH = "/fi/epitest/hostap/WPASupplicant/Interfaces"

WPAS_DBUS_SERVICE = "fi.epitest.hostap.WPASupplicant"
WPAS_DBUS_INTERFACE = "fi.epitest.hostap.WPASupplicant"
WPAS_DBUS_INTERFACES_INTERFACE = "fi.epitest.hostap.WPASupplicant.Interface"
WPAS_DBUS_NETWORK_INTERFACE = "fi.epitest.hostap.WPASupplicant.Network"
WPAS_DBUS_BSSID_INTERFACE = "fi.epitest.hostap.WPASupplicant.BSSID"

TIMEOUT = 60

class PasswordLengthError(Exception):
    pass

class WPA_Supplicant_Network:
    def __init__(self, bus, path):
        self.bus = bus
        self.path = path
        self.net_obj = self.bus.get_object(WPAS_DBUS_SERVICE, path)
        self.net = dbus.Interface(self.net_obj, WPAS_DBUS_NETWORK_INTERFACE)

    # dict keys: ssid, bssid, key_mgmt, psk, scan_ssid, pairwise, group, eap, identity,
    # anonymous_identity, ca_cert, ca_cert2, client_cert, client_cert2, private_key, private_key2,
    # private_key_passwd, private_key2_passwd, phase1, phase2, eapol_flags
    #
    # Example: setNetwork({"ssid":dbus.String("MySSID", variant_level=1)),
    # "psk":dbus.String("MyPassword", variant_level=1))})
    def setNetwork(self, options):
        self.net.set(options)

    def enableNetwork(self):
        self.net.enable()

    def disableNetwork(self):
        self.net.disable()

class WPA_Supplicant_Interface:
    def __init__(self, bus, ifname, path):
        self.bus = bus
        self.ifname = ifname
        self.path = path
        self.if_obj = self.bus.get_object(WPAS_DBUS_SERVICE, path)
        self.iface = dbus.Interface(self. if_obj, WPAS_DBUS_INTERFACES_INTERFACE)

    def scan(self):
        self.iface.scan()

    def scanResults(self):
        return self.iface.scanResults()

    def addNetwork(self):
        path = self.iface.addNetwork()
        return self.getNetwork(path)

    def removeNetwork(self, network):
        self.iface.removeNetwork(network)

    def selectNetwork(self, network):
        self.iface.selectNetwork(network)

    def getNetworkPath(self, network_id):
        return "%s/Networks/%d" % (self.path, network_id)

    def getNetworkById(self, network_id):
        return WPA_Supplicant_Network(self.bus, self.getNetworkPath(network_id))

    def getNetwork(self, network):
        return WPA_Supplicant_Network(self.bus, network)

    # mode should be between 0 and 2
    def setAPScan(self, mode):
        self.iface.setAPScan(dbus.UInt32(mode))

    def disconnect(self):
        self.iface.disconnect()

    def getState(self):
        return self.iface.state()

    def getCapabilities(self):
        return self.iface.capabilities()

class WPA_Supplicant:
    def __init__(self):
        self.bus = dbus.SystemBus()
        self.wpas_obj = self.bus.get_object(WPAS_DBUS_SERVICE, WPAS_DBUS_OPATH)
        self.wpas = dbus.Interface(self.wpas_obj, WPAS_DBUS_INTERFACE)

    def getInterface(self, ifname):
        path = self.wpas.getInterface(ifname)
        return WPA_Supplicant_Interface(self.bus, ifname, path)

    # driver=wext, hostap, prism54, madwifi, atmel, ndiswrapper, ipw, wired
    def addInterface(self, ifname, driver):
        self.wpas.addInterface(ifname, {'driver': dbus.String(driver, variant_level=1)})
        return self.getInterface(ifname)

    def removeInterface(self, ifname):
        try:
            iface_path = self.wpas.getInterface(ifname)
        except dbus.DBusException:
            iface_path = None
        if iface_path:
            self.wpas.removeInterface(dbus.ObjectPath(iface_path))

def detectWpaDriver(ifname):
    import os
    import sys
    import pardus.netutils
    # if device is an ethernet device, driver is "wired"
    device = pardus.netutils.IF(ifname)
    if (device.isEthernet()) and (not device.isWireless()):
        return "wired"
    path = os.path.join("/sys/class/net/", ifname, "device/driver/module")
    modname = None
    if os.path.exists(path):
        modname = os.readlink(path).split("/")[-1]
        if "hostap" in modname:
            return "hostap"
        if "prism54" in modname:
            return "prism54"
        if "atmel" in modname:
            return "atmel"
    # we fallback to wext
    # wext is the generic driver for ipw2100, ipw2200, ndiswrapper > 1.12, madwifi etc...
    return "wext"

def getWpaInterface(ifname):
    wpa = WPA_Supplicant()
    try:
        iface = wpa.getInterface(ifname)
    except dbus.DBusException:
        driver = detectWpaDriver(ifname)
        iface = wpa.addInterface(ifname, driver)
    return iface

def waitForAuthenticationComplete(iface, timeout, wait = 0.1):
    import time
    while timeout > 0:
        if iface.getState() == "COMPLETED":
            return True
        else:
            timeout -= wait
        time.sleep(wait)
    return False

def checkServiceState(serviceName):
    bus = dbus.SystemBus()
    obj = bus.get_object("tr.org.pardus.comar", "/package/%s" % serviceName)
    state = obj.info(dbus_interface="tr.org.pardus.comar.System.Service")[2]
    return state in ("on", "started")

def isDBusServiceActive():
    return True

def isWpaServiceActive():
    return checkServiceState("wpa_supplicant")

def isWpaServiceUsable():
    return isDBusServiceActive() and isWpaServiceActive()

def startWpaService():
    if not isWpaServiceActive():
        bus = dbus.SystemBus()
        obj = bus.get_object("tr.org.pardus.comar", "/package/wpa_supplicant")
        obj.start(dbus_interface="tr.org.pardus.comar.System.Service")
    import time
    timeout = 10
    while timeout > 0:
        try:
            bus = dbus.SystemBus()
            net_obj = bus.get_object(WPAS_DBUS_SERVICE, WPAS_DBUS_OPATH)
            net = dbus.Interface(net_obj, WPAS_DBUS_NETWORK_INTERFACE)
        except dbus.DBusException:
            time.sleep(0.1)
            timeout -= 0.2
            continue
        return True
    return False

def setWpaAuthentication(ifname, ssid, password, timeout = TIMEOUT):
    password_length = len(password)
    if (password_length < 8) or (password_length > 63):
        raise PasswordLengthError("Password length should be between 8 and 63")
    iface = getWpaInterface(ifname)
    network = iface.addNetwork()
    network.setNetwork({"ssid": dbus.String(ssid, variant_level=1), "psk": dbus.String(password, variant_level=1)})
    iface.selectNetwork(network.path)
    authentication = waitForAuthenticationComplete(iface, timeout)
    if not authentication:
        disableAuthentication(ifname)
    return authentication

def disableAuthentication(ifname):
    wpa = WPA_Supplicant()
    wpa.removeInterface(ifname)
    bus = dbus.SystemBus()
    obj = bus.get_object("tr.org.pardus.comar", "/package/wpa_supplicant")
    obj.stop(dbus_interface="tr.org.pardus.comar.System.Service")

class Wpa_EAP:
    ssid = ""
    phase1 = ""
    phase2 = ""
    key_mgmt = "IEEE8021X"
    eap = "PEAP"
    anonymous_identity = ""
    ca_cert = ""
    client_cert = ""
    private_key = ""
    private_key_passwd = ""

    def __init__(self, ifname):
        self.ifname = ifname
        self.iface = getWpaInterface(ifname)
        self.network = self.iface.addNetwork()

    def authenticate(self, username, password, timeout = TIMEOUT):
        basic = {"ssid": dbus.String(self.ssid, variant_level=1),
                 "key_mgmt": dbus.String(self.key_mgmt, variant_level=1),
                 "eap": dbus.String(self.eap, variant_level=1),
                 "identity": dbus.String(username, variant_level=1)}

        if self.client_cert:
            basic["client_cert"] = dbus.String(self.client_cert, variant_level=1)
        if self.ca_cert:
            basic["ca_cert"] = dbus.String(self.ca_cert, variant_level=1)
        if self.private_key:
            basic["private_key"] = dbus.String(self.private_key, variant_level=1)
        if self.private_key_passwd:
            basic["private_key_passwd"] = dbus.String(self.private_key_passwd, variant_level=1)
        if self.phase2:
            basic["phase2"] = dbus.String("auth=%s"%self.phase2, variant_level=1)
        if password:
            basic["password"] = dbus.String(password, variant_level=1)
        if self.anonymous_identity:
            basic["anonymous_identity"] = dbus.String(self.anonymous_identity, variant_level=1)

        self.network.setNetwork(basic)

        self.iface.selectNetwork(self.network.path)
        authentication = waitForAuthenticationComplete(self.iface, timeout)
        if not authentication:
            disableAuthentication(self.ifname)
        return authentication


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>wpa_supplicant</Name>
        <Homepage>http://hostap.epitest.fi/wpa_supplicant/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <License>BSD</License>
        <IsA>service</IsA>
        <Summary>IEEE 802.1X/WPA supplicant for secure wireless transfers</Summary>
        <Description>wpa_supplicant is a WPA supplicant with support for WPA and WPA2.</Description>
        <Archive sha1sum="8189704e257c3e9f8300c49dc6e49a381b1d6299" type="targz">http://hostap.epitest.fi/releases/wpa_supplicant-2.6.tar.gz</Archive>
        <AdditionalFiles>
            <AdditionalFile target="wpa_supplicant/.config">wpa_supplicant.config</AdditionalFile>
        </AdditionalFiles>
        <BuildDependencies>
            <Dependency>libnl-devel</Dependency>
            <Dependency>openssl-devel</Dependency>
            <Dependency>dbus-devel</Dependency>
            <Dependency>readline-devel</Dependency>
        </BuildDependencies>
        <Patches>
            <Patch level="1">ubuntu/01_use_pkg-config_for_pcsc-lite_module.patch</Patch>
            <!--<Patch level="1">wpa_supplicant-1.0-generate-libeap-peer.patch</Patch>-->
            <Patch level="1">wpa_supplicant-1.0-dbus-path-fix.patch</Patch>
            <!--Patch level="1">wpa_supplicant-1.0-do-not-call-dbus-functions-with-NULL-path.patch</Patch-->
            <Patch level="1">mandriva/wpa_supplicant-0.6.3-WEP232.patch</Patch>
            <Patch level="1">fedora/wpa_supplicant-openssl-more-algs.patch</Patch>
            <Patch level="1">fedora/wpa_supplicant-flush-debug-output.patch</Patch>
            <!--<Patch level="1">fedora/wpa_supplicant-squelch-driver-disconnect-spam.patch</Patch>-->
            <!--<Patch level="1">fedora/wpa_supplicant-dbus-service-file-args.patch</Patch>-->
            <Patch level="1">fedora/wpa_supplicant-assoc-timeout.patch</Patch>
            <!--<Patch level="1">fedora/wpa_supplicant-quiet-scan-results-message.patch</Patch>-->

            <!--<Patch>suse/wpa_supplicant-driver-wext-debug.patch</Patch>-->
            <Patch>suse/wpa_supplicant-errormsg.patch</Patch>

            <!-- Add 3 patches from git://w1.fi/srv/git/hostap-07.git -->
            <!--<Patch level="1">0001-AP-Verify-that-HT40-secondary-channel-is-supported.patch</Patch>-->
            <!--<Patch level="1">0002-nl80211-Set-cipher-suites-when-using-user-space-SME.patch</Patch>-->
            <!--<Patch level="1">0003-dbus-Emit-property-changed-events-when-adding-removi.patch</Patch>-->
        </Patches>
    </Source>

    <Package>
        <Name>wpa_supplicant</Name>
        <RuntimeDependencies>
            <Dependency>libnl</Dependency>
            <Dependency>dbus</Dependency>
            <Dependency>openssl</Dependency>
            <Dependency>readline</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="config">/etc</Path>
            <Path fileType="data">/etc/dbus-1</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="data">/usr/share/dbus-1/system-services</Path>
            <Path fileType="data">/run</Path>
        </Files>
        <AdditionalFiles>
            <AdditionalFile owner="root" permission="0600" target="/etc/wpa_supplicant.conf">wpa_supplicant.conf</AdditionalFile>
            <!-- This is the fedora one
            <AdditionalFile owner="root" permission="0600" target="/etc/wpa_supplicant.conf">wpa_supplicant.conf.fedora</AdditionalFile>
            -->
            <AdditionalFile owner="root" permission="0644" target="/etc/conf.d/wpa_supplicant">wpa_supplicant.confd</AdditionalFile>
            <AdditionalFile owner="root" permission="0644" target="/etc/logrotate.d/wpa_supplicant">wpa_supplicant.logrotate</AdditionalFile>
            <AdditionalFile owner="root" permission="0644" target="/usr/lib/python2.7/site-packages/wpa_supplicant.py">wpa_supplicant.py</AdditionalFile>
        </AdditionalFiles>
        <!-- This service is not started by default since NM starts it automatically. Keep service for those not using NM and start wpa-supp service manually -->
        <Provides>
            <COMAR script="service.py">System.Service</COMAR>
        </Provides>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-02-17</Date>
            <Version>2.6</Version>
            <Comment>Version bump.</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>2.4</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2015-07-15</Date>
            <Version>2.4</Version>
            <Comment>First release</Comment>
            <Name>Ayhan Yalçınsoy</Name>
            <Email>ayhanyalcinsoy@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>wpa_supplicant</Name>
        <Summary xml:lang="tr">Güvenli kablosuz erişim için IEEE 802.1X/WPA sağlayıcı</Summary>
        <Description xml:lang="tr">WPA ve WPA2 desteği olan ve Linux, BSD ve Windows ortamları için bir WPA istemcisidir.</Description>
    </Source>
</PISI>


code:
<PISI>
    <Name>network.download</Name>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
from pisi.actionsapi import get

def setup():
    autotools.configure("--prefix=/usr --sysconfdir=/etc \
                         --disable-rpath \
                         --with-ssl=openssl")

def build():
    autotools.make()

def install():
    autotools.install()

    # default root certs location
    shelltools.echo("%s/etc/wgetrc" % get.installDIR(), "ca_certificate=/etc/ssl/certs/ca-certificates.crt")

    pisitools.dodoc("AUTHORS", "COPYING", "ChangeLog*", "NEWS", "README", "MAILING-LIST")


code:
diff -Naurp wget-1.12/doc/wget.texi wget-1.12.oden/doc/wget.texi
--- wget-1.12/doc/wget.texi	2010-09-02 12:21:40.000000000 -0400
+++ wget-1.12.oden/doc/wget.texi	2010-09-02 12:22:13.000000000 -0400
@@ -1487,6 +1487,13 @@ This option is useful for some file-down
 @code{Content-Disposition} headers to describe what the name of a
 downloaded file should be.

+@cindex Trust server names
+@item --trust-server-names
+
+If this is set to on, on a redirect the last component of the
+redirection URL will be used as the local file name.  By default it is
+used the last component in the original URL.
+
 @cindex authentication
 @item --auth-no-challenge

@@ -2799,6 +2806,10 @@ Set the connect timeout---the same as @s
 Turn on recognition of the (non-standard) @samp{Content-Disposition}
 HTTP header---if set to @samp{on}, the same as @samp{--content-disposition}.

+@item trust_server_names = on/off
+If set to on, use the last component of a redirection URL for the local
+file name.
+
 @item continue = on/off
 If set to on, force continuation of preexistent partially retrieved
 files.  See @samp{-c} before setting it.
diff -Naurp wget-1.12/src/http.c wget-1.12.oden/src/http.c
--- wget-1.12/src/http.c	2010-09-02 12:21:40.000000000 -0400
+++ wget-1.12.oden/src/http.c	2010-09-02 12:22:13.000000000 -0400
@@ -2410,8 +2410,9 @@ File %s already there; not retrieving.\n
 /* The genuine HTTP loop!  This is the part where the retrieval is
    retried, and retried, and retried, and...  */
 uerr_t
-http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
-           int *dt, struct url *proxy, struct iri *iri)
+http_loop (struct url *u, struct url *original_url, char **newloc,
+           char **local_file, const char *referer, int *dt, struct url *proxy,
+           struct iri *iri)
 {
   int count;
   bool got_head = false;         /* used for time-stamping and filename detection */
@@ -2457,7 +2458,8 @@ http_loop (struct url *u, char **newloc,
     }
   else if (!opt.content_disposition)
     {
-      hstat.local_file = url_file_name (u);
+      hstat.local_file =
+        url_file_name (opt.trustservernames ? u : original_url);
       got_name = true;
     }

@@ -2497,7 +2499,7 @@ File %s already there; not retrieving.\n

   /* Send preliminary HEAD request if -N is given and we have an existing
    * destination file. */
-  file_name = url_file_name (u);
+  file_name = url_file_name (opt.trustservernames ? u : original_url);
   if (opt.timestamping
       && !opt.content_disposition
       && file_exists_p (file_name))
@@ -2852,9 +2854,9 @@ Remote file exists.\n\n"));

           /* Remember that we downloaded the file for later ".orig" code. */
           if (*dt & ADDED_HTML_EXTENSION)
-            downloaded_file(FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
+            downloaded_file (FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
           else
-            downloaded_file(FILE_DOWNLOADED_NORMALLY, hstat.local_file);
+            downloaded_file (FILE_DOWNLOADED_NORMALLY, hstat.local_file);

           ret = RETROK;
           goto exit;
@@ -2885,9 +2887,9 @@ Remote file exists.\n\n"));

               /* Remember that we downloaded the file for later ".orig" code. */
               if (*dt & ADDED_HTML_EXTENSION)
-                downloaded_file(FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
+                downloaded_file (FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
               else
-                downloaded_file(FILE_DOWNLOADED_NORMALLY, hstat.local_file);
+                downloaded_file (FILE_DOWNLOADED_NORMALLY, hstat.local_file);

               ret = RETROK;
               goto exit;
diff -Naurp wget-1.12/src/http.h wget-1.12.oden/src/http.h
--- wget-1.12/src/http.h	2009-09-04 12:31:54.000000000 -0400
+++ wget-1.12.oden/src/http.h	2010-09-02 12:22:13.000000000 -0400
@@ -33,8 +33,8 @@ as that of the covered work.  */

 struct url;

-uerr_t http_loop (struct url *, char **, char **, const char *, int *,
-		  struct url *, struct iri *);
+uerr_t http_loop (struct url *, struct url *, char **, char **, const char *,
+                  int *, struct url *, struct iri *);
 void save_cookies (void);
 void http_cleanup (void);
 time_t http_atotm (const char *);
diff -Naurp wget-1.12/src/init.c wget-1.12.oden/src/init.c
--- wget-1.12/src/init.c	2010-09-02 12:21:40.000000000 -0400
+++ wget-1.12.oden/src/init.c	2010-09-02 12:22:13.000000000 -0400
@@ -244,6 +244,7 @@ static const struct {
   { "timeout",          NULL,                   cmd_spec_timeout },
   { "timestamping",     &opt.timestamping,      cmd_boolean },
   { "tries",            &opt.ntry,              cmd_number_inf },
+  { "trustservernames", &opt.trustservernames,  cmd_boolean },
   { "useproxy",         &opt.use_proxy,         cmd_boolean },
   { "user",             &opt.user,              cmd_string },
   { "useragent",        NULL,                   cmd_spec_useragent },
diff -Naurp wget-1.12/src/main.c wget-1.12.oden/src/main.c
--- wget-1.12/src/main.c	2010-09-02 12:21:40.000000000 -0400
+++ wget-1.12.oden/src/main.c	2010-09-02 12:22:13.000000000 -0400
@@ -268,6 +268,7 @@ static struct cmdline_option option_data
     { "timeout", 'T', OPT_VALUE, "timeout", -1 },
     { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 },
     { "tries", 't', OPT_VALUE, "tries", -1 },
+    { "trust-server-names", 0, OPT_BOOLEAN, "trustservernames", -1 },
     { "user", 0, OPT_VALUE, "user", -1 },
     { "user-agent", 'U', OPT_VALUE, "useragent", -1 },
     { "verbose", 'v', OPT_BOOLEAN, "verbose", -1 },
@@ -679,6 +680,8 @@ Recursive accept/reject:\n"),
     N_("\
   -I,  --include-directories=LIST  list of allowed directories.\n"),
     N_("\
+  --trust-server-names  use the name specified by the redirection url last component.\n"),
+    N_("\
   -X,  --exclude-directories=LIST  list of excluded directories.\n"),
     N_("\
   -np, --no-parent                 don't ascend to the parent directory.\n"),
diff -Naurp wget-1.12/src/options.h wget-1.12.oden/src/options.h
--- wget-1.12/src/options.h	2010-09-02 12:21:40.000000000 -0400
+++ wget-1.12.oden/src/options.h	2010-09-02 12:22:13.000000000 -0400
@@ -243,6 +243,7 @@ struct options
   char *encoding_remote;
   char *locale;

+  bool trustservernames;
 #ifdef __VMS
   int ftp_stmlf;                /* Force Stream_LF format for binary FTP. */
 #endif /* def __VMS */
diff -Naurp wget-1.12/src/retr.c wget-1.12.oden/src/retr.c
--- wget-1.12/src/retr.c	2009-09-04 12:31:54.000000000 -0400
+++ wget-1.12.oden/src/retr.c	2010-09-02 12:22:13.000000000 -0400
@@ -689,7 +689,8 @@ retrieve_url (struct url * orig_parsed,
 #endif
       || (proxy_url && proxy_url->scheme == SCHEME_HTTP))
     {
-      result = http_loop (u, &mynewloc, &local_file, refurl, dt, proxy_url, iri);
+      result = http_loop (u, orig_parsed, &mynewloc, &local_file, refurl, dt,
+                          proxy_url, iri);
     }
   else if (u->scheme == SCHEME_FTP)
     {


code:
Index: doc/sample.wgetrc
===================================================================
--- doc/sample.wgetrc.orig
+++ doc/sample.wgetrc
@@ -114,6 +114,9 @@

 # To try ipv6 addresses first:
 #prefer-family = IPv6
+#
+# Let the DNS resolver decide whether to prefer IPv4 or IPv6
+prefer-family = none

 # Set default IRI support state
 #iri = off


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>wget</Name>
        <Homepage>http://www.gnu.org/software/wget/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv3+</License>
        <IsA>app:console</IsA>
        <Summary>Command-line utility to retrieve files from remote systems</Summary>
        <Description>GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.</Description>
        <Archive sha1sum="38757ecc4e61adcaf7ad0cd64a5180d7d310fe16" type="tarxz">http://ftp.gnu.org/gnu/wget/wget-1.19.tar.xz</Archive>
        <BuildDependencies>
            <Dependency>openssl-devel</Dependency>
            <Dependency>zlib-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>wget</Name>
        <RuntimeDependencies>
            <Dependency>zlib</Dependency>
            <Dependency>openssl</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="config">/etc</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="info">/usr/share/info</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="localedata">/usr/share/locale</Path>
        </Files>
    </Package>

    <History>
        <Update release="4">
            <Date>2017-02-17</Date>
            <Version>1.19</Version>
            <Comment>Version bump.</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="3">
            <Date>2016-10-27</Date>
            <Version>1.18</Version>
            <Comment>Version bump.</Comment>
            <Name>Yusuf Aydemir</Name>
            <Email>yusuf.aydemir@pisilnux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.17.1</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-03-25</Date>
            <Version>1.17.1</Version>
            <Comment>First release</Comment>
            <Name>Kamil Atlı</Name>
            <Email>suvari@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>wget</Name>
        <Summary xml:lang="tr">Http ve ftp gibi internet protokollerini kullanarak dosya indirebilen bir yazılım</Summary>
        <Description xml:lang="tr">GNU Wget, HTTP, HTTPS ve FTP gibi en çok kullanılan Internet protokollerini kullanarak dosyalara ulaşmak icin kullanılan bir özgür yazılım paketidir. Etkileşimsiz bir komutsatırı aracıdır, böylece X-Windows desteği olmadan, betikler, işlemler, terminal kullanımı gerçekleştirilebilir.</Description>
    </Source>
</PISI>


code:
<PISI>
    <Name>network.filter</Name>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

def setup():
    autotools.configure()

def build():
    autotools.make('CC="%s" RPM_OPT_FLAGS="%s"' % (get.CC(), get.CFLAGS()))

def install():
    autotools.rawInstall("DESTDIR=\"%s\" \
                          SBINDIR=/sbin \
                          DOCDIR=/%s/%s \
                          MANDIR=/usr/share/man \
                          " % (get.installDIR(), get.docDIR(), get.srcNAME()))

    pisitools.dodir("/var/lib/arpd")


code:
From f0624f6cc656cb177b64e2664f2a806221bfab58 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Thu, 28 Jul 2016 08:49:20 +0200
Subject: [PATCH 1/1] make iproute2 fhs compliant

Signed-off-by: Christian Hesse <mail@eworm.de>
---
 Makefile       |  2 +-
 netem/Makefile |  4 ++--
 tc/q_netem.c   |  2 +-
 tc/tc_util.c   | 15 +++++++++++++++
 tc/tc_util.h   |  1 +
 5 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index eb571a5..db0a04c 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ DBM_INCLUDE:=$(DESTDIR)/usr/include

 SHARED_LIBS = y

-DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
+DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" -DDATADIR=\"$(DATADIR)\"
 ifneq ($(SHARED_LIBS),y)
 DEFINES+= -DNO_SHARED_LIBS
 endif
diff --git a/netem/Makefile b/netem/Makefile
index e52e125..5b4d283 100644
--- a/netem/Makefile
+++ b/netem/Makefile
@@ -20,9 +20,9 @@ stats: stats.c
 	$(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm

 install: all
-	mkdir -p $(DESTDIR)$(LIBDIR)/tc
+	mkdir -p $(DESTDIR)$(DATADIR)/tc
 	for i in $(DISTDATA); \
-	do install -m 644 $$i $(DESTDIR)$(LIBDIR)/tc; \
+	do install -m 644 $$i $(DESTDIR)$(DATADIR)/tc; \
 	done

 clean:
diff --git a/tc/q_netem.c b/tc/q_netem.c
index 8fe2204..a15a5c7 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -113,7 +113,7 @@ static int get_distribution(const char *type, __s16 *data, int maxdata)
 	char *line = NULL;
 	char name[128];

-	snprintf(name, sizeof(name), "%s/%s.dist", get_tc_lib(), type);
+	snprintf(name, sizeof(name), "%s/%s.dist", get_tc_datadir(), type);
 	if ((f = fopen(name, "r")) == NULL) {
 		fprintf(stderr, "No distribution data for %s (%s: %s)\n",
 			type, name, strerror(errno));
diff --git a/tc/tc_util.c b/tc/tc_util.c
index afc4cf5..728b854 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -32,6 +32,10 @@
 #define LIBDIR "/usr/lib"
 #endif

+#ifndef DATADIR
+#define DATADIR "/usr/share"
+#endif
+
 static struct db_names *cls_names;

 #define NAMES_DB "/etc/iproute2/tc_cls"
@@ -73,6 +77,17 @@ const char *get_tc_lib(void)
 	return lib_dir;
 }

+const char *get_tc_datadir(void)
+{
+	const char *data_dir;
+
+	data_dir = getenv("TC_DATA_DIR");
+	if (!data_dir)
+		data_dir = DATADIR "/tc/";
+
+	return data_dir;
+}
+
 int get_qdisc_handle(__u32 *h, const char *str)
 {
 	__u32 maj;
diff --git a/tc/tc_util.h b/tc/tc_util.h
index 61e60b1..6d448de 100644
--- a/tc/tc_util.h
+++ b/tc/tc_util.h
@@ -55,6 +55,7 @@ struct exec_util {
 };

 const char *get_tc_lib(void);
+const char *get_tc_datadir(void);

 struct qdisc_util *get_qdisc_kind(const char *str);
 struct filter_util *get_filter_kind(const char *str);


code:
diff -up iproute2-2.6.29/ip/ipxfrm.c.old iproute2-2.6.29/ip/ipxfrm.c
--- iproute2-2.6.29/ip/ipxfrm.c.old	2009-03-24 23:15:14.000000000 +0100
+++ iproute2-2.6.29/ip/ipxfrm.c	2009-04-24 09:35:58.203735119 +0200
@@ -1156,6 +1156,7 @@ static int xfrm_selector_upspec_parse(st
 		case IPPROTO_UDP:
 		case IPPROTO_SCTP:
 		case IPPROTO_DCCP:
+		case IPPROTO_IP:	/* to allow shared SA for different protocols */
 			break;
 		default:
 			fprintf(stderr, "\"sport\" and \"dport\" are invalid with proto=%s\n", strxf_proto(sel->proto));


code:
diff -up iproute2-20091009/Makefile.kernel iproute2-20091009/Makefile
--- iproute2-20091009/Makefile.kernel	2009-09-21 10:26:11.000000000 +0200
+++ iproute2-20091009/Makefile	2009-10-09 12:27:03.687382422 +0200
@@ -6,6 +6,7 @@ CONFDIR=/etc/iproute2
 DOCDIR=/share/doc/iproute2
 MANDIR=/share/man
 ARPDDIR=/var/lib/arpd
+KERNEL_INCLUDE=/usr/include

 # Path to db_185.h include
 DBM_INCLUDE:=$(ROOTDIR)/usr/include


code:
diff -up iproute2-2.6.31/Makefile.old iproute2-2.6.31/Makefile
--- iproute2-2.6.31/Makefile.old	2010-01-04 12:46:47.000000000 +0100
+++ iproute2-2.6.31/Makefile	2010-01-04 12:50:17.396384644 +0100
@@ -13,7 +13,7 @@ DBM_INCLUDE:=$(ROOTDIR)/usr/include

 SHARED_LIBS = y

-DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
+DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
 ifneq ($(SHARED_LIBS),y)
 DEFINES+= -DNO_SHARED_LIBS
 endif


code:
diff -up iproute2-20091106/examples/cbq.init-v0.7.3.fix iproute2-20091106/examples/cbq.init-v0.7.3
--- iproute2-20091106/examples/cbq.init-v0.7.3.fix	2009-11-10 19:41:44.000000000 +0100
+++ iproute2-20091106/examples/cbq.init-v0.7.3	2009-11-27 13:36:07.957310549 +0100
@@ -579,14 +579,14 @@ cbq_show () {
 ### Check configuration and load DEVICES, DEVFIELDS and CLASSLIST from $1
 cbq_init () {
 	### Get a list of configured classes
-	CLASSLIST=`find $1 \( -type f -or -type l \) -name 'cbq-*' \
-		-not -name '*~' -maxdepth 1 -printf "%f\n"| sort`
+	CLASSLIST=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
+		-not -name '*~' -printf "%f\n"| sort`
 	[ -z "$CLASSLIST" ] &&
 		cbq_failure "no configuration files found in $1!"

 	### Gather all DEVICE fields from $1/cbq-*
-	DEVFIELDS=`find $1 \( -type f -or -type l \) -name 'cbq-*' \
-		  -not -name '*~' -maxdepth 1| xargs sed -n 's/#.*//; \
+	DEVFIELDS=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
+		  -not -name '*~' | xargs sed -n 's/#.*//; \
 		  s/[[:space:]]//g; /^DEVICE=[^,]*,[^,]*\(,[^,]*\)\?/ \
 		  { s/.*=//; p; }'| sort -u`
 	[ -z "$DEVFIELDS" ] &&


code:
From: Jan Engelhardt <jengelh@medozas.de>
Date: 2011-06-01 00:52:29+0200

---
 tc/m_xt.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: iproute2-2.6.38/tc/m_xt.c
===================================================================
--- iproute2-2.6.38.orig/tc/m_xt.c
+++ iproute2-2.6.38/tc/m_xt.c
@@ -162,7 +162,8 @@ static int parse_ipt(struct action_util
 					return -1;
 				}
 				tcipt_globals.opts =
-				    xtables_merge_options(tcipt_globals.opts,
+				    xtables_merge_options(tcipt_globals.orig_opts,
+				                          tcipt_globals.opts,
 				                          m->extra_opts,
 				                          &m->option_offset);
 			} else {
@@ -307,7 +308,8 @@ print_ipt(struct action_util *au,FILE *
 			}

 			tcipt_globals.opts =
-			    xtables_merge_options(tcipt_globals.opts,
+			    xtables_merge_options(tcipt_globals.orig_opts,
+			                          tcipt_globals.opts,
 			                          m->extra_opts,
 			                          &m->option_offset);
 		} else {


code:
From: Jan Engelhardt <jengelh@medozas.de>
Date: 2011-06-01 00:52:07+0200

---
 tc/m_xt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: iproute2-2.6.37/tc/m_xt.c
===================================================================
--- iproute2-2.6.37.orig/tc/m_xt.c
+++ iproute2-2.6.37/tc/m_xt.c
@@ -343,8 +343,8 @@ print_ipt(struct action_util *au,FILE *
 	return 0;
 }

-struct action_util ipt_action_util = {
-        .id = "ipt",
+struct action_util xt_action_util = {
+        .id = "xt",
         .parse_aopt = parse_ipt,
         .print_aopt = print_ipt,
 };


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>iproute2</Name>
        <Homepage>http://linux-net.osdl.org/index.php/Iproute2</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        <Summary>Kernel routing and traffic control utilities</Summary>
        <Description>Iproute2 is a collection of utilites for controlling TCP/IP networking and traffic control in Linux.</Description>
        <Archive sha1sum="fc28f956a7a9695473312d0ed35dc24a7ef9d7f6" type="tarxz">https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.9.0.tar.xz</Archive>
        <BuildDependencies>
            <Dependency versionFrom="1.6.0">iptables-devel</Dependency>
            <Dependency>db-devel</Dependency>
            <Dependency>elfutils</Dependency>
        </BuildDependencies>
        <Patches>
            <Patch>0001-make-iproute2-fhs-compliant.patch</Patch>
        </Patches>
    </Source>

    <Package>
        <Name>iproute2</Name>
        <RuntimeDependencies>
            <Dependency versionFrom="1.6.0">iptables</Dependency>
            <Dependency>db</Dependency>
            <Dependency>elfutils</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="config">/etc</Path>
            <Path fileType="executable">/sbin</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="data">/usr/share/tc</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="data">/usr/share/bash-completion</Path>
            <Path fileType="data">/var/lib</Path>
        </Files>
    </Package>

    <History>
        <Update release="4">
            <Date>2017-01-29</Date>
            <Version>4.9.0</Version>
            <Comment>Version bump.</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="3">
            <Date>2016-10-19</Date>
            <Version>4.8.0</Version>
            <Comment>Version bump.</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>4.4.0</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-03-05</Date>
            <Version>4.4.0</Version>
            <Comment>First release</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>iproute2</Name>
        <Summary xml:lang="tr">Çekirdek içinde yer alan ağ trafiği yönlendirme ve trafik kontrol araçları.</Summary>
        <Description xml:lang="tr">Iproute2 TCP/IP ağları ve trafik kontrolü için araçlar içeren bir koolleksiyondur.</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
from pisi.actionsapi import get

def setup():
    autotools.configure("--sbindir=/sbin \
                         --libexecdir=/usr/lib \
                         --without-kernel \
                         --enable-devel \
                         --disable-nftables \
                         --enable-libipq \
                         --enable-shared \
                         --enable-static")

    pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")

def build():
    autotools.make("V=1")

def install():
    autotools.rawInstall('DESTDIR="%s"' % get.installDIR())

    pisitools.insinto("/usr/include", "include/iptables.h")
    pisitools.insinto("/usr/include", "include/ip6tables.h")
    pisitools.insinto("/usr/include/libiptc", "include/libiptc/*.h")

    pisitools.dodir("/var/lib/iptables")
    pisitools.dodir("/etc/iptables")


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

# i18n

MSG_CONNECTION_NAME = {
    "en": "Internet Sharing",
    "tr": "Internet Paylaşımı",
    "sv": "Internetdelning",
    "fr": "Partage de connexion Internet",
    "es": "Compartir Internet",
    "de": "Internet Freigabe",
    "nl": "Internetverbinding delen",
}

MSG_ALLOWED_PORTS = {
    "en": "Allowed Port Numbers",
    "tr": "İzin Verilen Port Numaraları",
    "sv": "Tillåtna portar",
    "fr": "Numéros de port autorisés",
    "es": "Números de puertos permitidos",
    "de": "Erlaubte Ports",
    "nl": "Toegestane poortnummers",
}

MSG_FORBIDDEN_PORTS = {
    "en": "Forbidden Port Numbers",
    "tr": "İzin Verilmeyen Port Numaraları",
    "sv": "Otillåtna portar",
    "nl": "Verboden poortnummers",
}

MSG_GATEWAY_HOME = {
    "en": "Gate to Home Network",
    "tr": "Ev Ağına Çıkış",
    "sv": "Länk till lokalt nätverk",
    "fr": "Passerelle vers le réseau local",
    "es": "Enlace a la red doméstica",
    "de": "Gateway zum Haus-Netzwerk",
    "nl": "Gateway naar thuisnetwerk",
}

MSG_GATEWAY_INTERNET = {
    "en": "Gate to Internet",
    "tr": "Internet'e Çıkış",
    "sv": "Länk till internet",
    "fr": "Passerelle vers Internet",
    "es": "Enlace a Internet",
    "de": "Gateway zum Internet",
    "nl": "Gateway naar Internet",
}

TITLE_BLOCK_INCOMING = {
    "en": "Block Incoming Connections",
    "tr": "Gelen Bağlantıları Engelle",
    "sv": "Blockera inkommande anslutningar",
    "fr": "Bloquer les connexions entrantes",
    "es": "Bloquear conexiones entrantes",
    "de": "Eingehende Verbindungen blockieren",
    "nl": "Inkomende verbindingen blokkeren",
}
DESCRIPTION_BLOCK_INCOMING = {
    "en": "Blocks all incoming connections to the computer. Exceptions can be set from configuration dialog.",
    "tr": "Bilgisayara gelen tüm bağlantıları engeller. İstisnalar ayarlar penceresinden belirlenebilir.",
    "sv": "Blockerar alla inkommande anslutningar till datorn. Undantag kan läggas till under inställningar.",
    "fr": "Bloque  toute les connexions entrantes dans l'ordinateur. Des exceptions peuvent être définies dans la fenêtre de configuration.",
    "es": "Bloquea todas las conexiones entrantes a la computadora. Se puede especificar excepciones desde el dialogo de configuración.",
    "de": "Blockiert alle eingehenden Verbindungen. Im Konfigurations-Dialog können Ausnahmen angegeben werden.",
    "nl": "Alle inkomende verbindingen naar deze computer blokkeren. Uitzonderingen kunnen in een configuratiedialoog ingesteld worden.",
}

TITLE_BLOCK_OUTGOING = {
    "en": "Block Outgoing Connections",
    "tr": "Giden Bağlantıları Engelle",
    "sv": "Blockera utgående anslutningar",
    "fr": "Bloquer les connexions sortantes",
    "es": "Bloquear conexiones salientes",
    "de": "Ausgehende Verbindungen blockieren",
    "nl": "Uitgaande verbindingen blokkeren",
}
DESCRIPTION_BLOCK_OUTGOING = {
    "en": "Blocks outgoing connections. Forbidden ports can be set from configuration dialog.",
    "tr": "Dışarı yapılan bağlantıları engeller. Yasaklı port numaraları ayarlar penceresinden belirlenebilir.",
    "sv": "Blockerar alla utgående anslutningar till datorn. Undantag kan läggas till under inställningar.",
    "nl": "Uitgaande verbindingen blokkeren. Verboden poorten kunnen in een configuratiedialoog ingesteld worden.",
}

TITLE_INTERNET_SHARING = {
    "en": "Internet Sharing",
    "tr": "Internet Paylaşımı",
    "sv": "Internetdelning",
    "fr": "Partage de connexion Internet",
    "es": "Compartir Internet",
    "de": "Internet Freigabe",
    "nl": "Internetverbinding delen",
}
DESCRIPTION_INTERNET_SHARING = {
    "en": "Allows computers in your local network to connect Internet through this computer.",
    "tr": "Yerel ağınızdaki bilgisayarların, bu bilgisayarı kullanarak Internet'e bağlanmalarını sağlar.",
    "sv": "Låter datorer i det lokala nätverket ansluta till internet via den här datorn.",
    "fr": "Permet aux ordinateurs de votre réseau domestique de se connecter à Internet via cet ordinateur.",
    "es": "Permitir a otros computadoras en su red local acceder a la Internet, a través de ésta computadora",
    "de": "Gibt anderen Computern aus dem lokalen Netzwer die Mäglichkeit, Internet durch diesen Computer hier zu benutzen.",
    "nl": "Geeft andere computers in het lokale netwerk via deze computer toegang tot het internet.",
}

# Don't touch below, if you don't know what you're doing.

# Module configuration settings and templates

FIREWALL_CONF = "/etc/firewall.conf"

IPTABLES_RULES = {
    'filter': [
        '-P INPUT DROP',                        # Default policies
        '-P FORWARD DROP',
        '-P OUTPUT ACCEPT',
        '-N PARDUS-IN',                         # Module container table for INPUT
        '-N PARDUS-IN-MOD-BLOCK',               # Table for BlockIncoming rules
        '-N PARDUS-FW',                         # Module container table for FORWARD
        '-N PARDUS-FW-MOD-SHARING',             # Table for InternetSharingModule rules
        '-N PARDUS-FW-MOD-BLOCK',               # Table for BlockOutgoing rules
        '-N PARDUS-OUT',                        # Module container table for OUTPUT
        '-N PARDUS-OUT-MOD-BLOCK',              # Table for BlockOutgoing rules
        '-A INPUT -i lo -j ACCEPT',             # Accept local
        '-A FORWARD -o lo -j ACCEPT',
        '-A INPUT -m state --state INVALID -j DROP',
        '-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT',
        '-A INPUT -j PARDUS-IN',                # Jump into container tables
        '-A FORWARD -j PARDUS-FW',
        '-A OUTPUT -j PARDUS-OUT',
        '-A PARDUS-IN -j PARDUS-IN-MOD-BLOCK' , # Jump into module tables
        '-A PARDUS-FW -j PARDUS-FW-MOD-BLOCK',
        '-A PARDUS-FW -j PARDUS-FW-MOD-SHARING',
        '-A PARDUS-OUT -j PARDUS-OUT-MOD-BLOCK',
        '-A INPUT -m state --state NEW -j ACCEPT',
    ],
    'nat': [
        '-P PREROUTING ACCEPT',
        '-P POSTROUTING ACCEPT',
        '-P OUTPUT ACCEPT',
        '-N PARDUS-POST',
        '-N PARDUS-POST-MOD-SHARING',
        '-A POSTROUTING -j PARDUS-POST',
        '-A PARDUS-POST -j PARDUS-POST-MOD-SHARING',
    ],
}

DHCPD_CONF = """
ddns-update-style interim;
ignore client-updates;
max-lease-time 500;
default-lease-time 500;
option domain-name-servers 193.140.100.220;
option routers 172.16.0.1;
option subnet-mask 255.255.255.0;
subnet 172.16.0.0 netmask 255.255.255.0 {
    range 172.16.0.2 172.16.0.254;
}
"""

# Utils

import os
import subprocess

from pardus import iniutils
from pardus import netutils
from pardus import netfilterutils

INI = iniutils.iniParser(FIREWALL_CONF)

def listModuleConfigs():
    """
        Returns a list of modules that are configured.
    """
    try:
        modules = INI.listSections()
    except iniutils.iniParserError:
        return
    if "general" in modules:
        modules.remove("general")
    return modules

class ModuleConfig:
    """
        Module configuration parser.
    """
    def __init__(self, name):
        self.name = name
        try:
            self.info = INI.getSection(name)
        except iniutils.iniParserError:
            self.info = {}

    def delete(self):
        INI.removeSection(self.name)

    def save(self):
        is_new = self.name not in listModuleConfigs()
        INI.setSection(self.name, self.info)

def getServiceState(package):
    """
        Returns state of a service.
    """
    return call(package, "System.Service", "info")[2] in ["on", "started"]

def stopService(package, permanent=False):
    """
        Stops a service.
    """
    call(package, "System.Service", "stop")
    if permanent:
        call(package, "System.Service", "setState", ("off"))

def startService(package, restart=False, auto_start=False):
    """
        Starts a service.
    """
    if restart:
        stopService(package)
    if not getServiceState(package):
        call(package, "System.Service", "start")
    if auto_start:
        call(package, "System.Service", "setState", ("on"))

def initializeIPTables():
    """
        Initializes IPTables.
    """
    # Active rules
    rules_active = netfilterutils.parseConf(netfilterutils.getRules())

    # Compare rules
    for chain, rules in IPTABLES_RULES.iteritems():
        if chain not in rules_active or len(set(rules) - set(rules_active[chain])):
            # At least one different rule, need re-initialization
            netfilterutils.clear()
            conf = netfilterutils.makeConf(IPTABLES_RULES)
            netfilterutils.restoreRules(conf)
            break

def execRule(rule):
    """
        Executes IPTables rule
    """
    rule = rule.split()
    rule.insert(0, "/sbin/iptables")
    subprocess.call(rule)

def createConnection(package, device):
    import comar
    link = comar.Link()
    connection = _(MSG_CONNECTION_NAME)
    link.Network.Link[package].setDevice(connection, device)
    link.Network.Link[package].setAddress(connection, "manual", "172.16.0.1", "255.255.255.0", "")
    return connection

def findOrCreateConnection(link, device):
    o_package, o_connecion = None, None
    for package in link.Network.Link:
        if device in link.Network.Link[package].deviceList():
            for connection in link.Network.Link[package].connections():
                info = link.Network.Link[package].connectionInfo(connection)
                if info.get("net_address", "") == "172.16.0.1":
                    return package, connection
            return package, createConnection(package, device)

def makeDHCPConf(interface):
    file("/etc/dhcp/dhcpd.conf", "w").write(DHCPD_CONF)
    file("/etc/conf.d/dhcpd", "w").write("DHCPD_IFACE=%s" % interface)

# Modules

class BlockIncoming:
    def __init__(self):
        self.parametersLast = {}

    def getInfo(self):
        title = _(TITLE_BLOCK_INCOMING)
        description = _(DESCRIPTION_BLOCK_INCOMING)
        icon = "network-server"
        return (title, description, icon)

    def getParameters(self):
        parameters = [
            ("port_exceptions", _(MSG_ALLOWED_PORTS), "editlist", {"format": "[0-9\-]+"}),
        ]
        return parameters

    def checkModule(self, parameters={}, quiet=False):
        pass

    def loadModule(self, parameters={}):
        # Initialize IPTables
        initializeIPTables()
        # Flush rules
        self.unloadModule()
        # Load rules
        for port in parameters.get("port_exceptions", "").split():
            if "-" in port:
                port = port.replace("-", ":")
            execRule("-A PARDUS-IN-MOD-BLOCK -p tcp -m multiport --dports %s -j ACCEPT" % port)
            execRule("-A PARDUS-IN-MOD-BLOCK -p udp -m multiport --dports %s -j ACCEPT" % port)
        # Block else...
        execRule("-A PARDUS-IN-MOD-BLOCK -p tcp -m multiport --dports 0:1024 -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j REJECT --reject-with icmp-port-unreachable")
        execRule("-A PARDUS-IN-MOD-BLOCK -p udp -m multiport --dports 0:1024 -j REJECT --reject-with icmp-port-unreachable")
        execRule("-A PARDUS-IN-MOD-BLOCK -j REJECT --reject-with icmp-host-prohibited")

    def unloadModule(self, shutdown=False):
        if not shutdown:
            # Unload rules
            execRule("-F PARDUS-IN-MOD-BLOCK")

class BlockOutgoing:
    def __init__(self):
        self.parametersLast = {}

    def getInfo(self):
        title = _(TITLE_BLOCK_OUTGOING)
        description = _(DESCRIPTION_BLOCK_OUTGOING)
        icon = "security-medium"
        return (title, description, icon)

    def getParameters(self):
        parameters = [
            ("port_exceptions", _(MSG_FORBIDDEN_PORTS), "editlist", {"format": "[0-9\-]+"}),
        ]
        return parameters

    def checkModule(self, parameters={}, quiet=False):
        pass

    def loadModule(self, parameters={}):
        # Initialize IPTables
        initializeIPTables()
        # Flush rules
        self.unloadModule()
        # Load rules
        for port in parameters.get("port_exceptions", "").split():
            if "-" in port:
                port = port.replace("-", ":")
            execRule("-A PARDUS-OUT-MOD-BLOCK -p tcp -m multiport --dports %s -j DROP" % port)
            execRule("-A PARDUS-OUT-MOD-BLOCK -p udp -m multiport --dports %s -j DROP" % port)
            execRule("-A PARDUS-FW-MOD-BLOCK -p tcp -m multiport --dports %s -j DROP" % port)
            execRule("-A PARDUS-FW-MOD-BLOCK -p udp -m multiport --dports %s -j DROP" % port)

    def unloadModule(self, shutdown=False):
        if not shutdown:
            # Unload rules
            execRule("-F PARDUS-OUT-MOD-BLOCK")
            execRule("-F PARDUS-FW-MOD-BLOCK")

class InternetSharingModule:
    def __init__(self):
        self.parametersLast = {}

    def getInfo(self):
        title = _(TITLE_INTERNET_SHARING)
        description = _(DESCRIPTION_INTERNET_SHARING)
        icon = "network-workgroup"
        return (title, description, icon)

    def getParameters(self):
        def findInterfaces(wireless=True):
            ifaces = []
            for iface in netutils.interfaces():
                if iface.name.startswith("lo") or iface.name.startswith("pan"):
                    continue
                if not wireless and iface.isWireless():
                    continue
                if iface.isEthernet():
                    dev_id = iface.deviceUID()
                    dev_name = netutils.deviceName(iface.deviceUID())
                    if " - " in dev_name:
                        dev_name = dev_name.split(" - ")[1]
                    ifaces.append("%s\t%s" % (dev_id, dev_name))
            return ifaces
        options_in = {
            "choose": "\n".join(findInterfaces())
        }
        options_out = {
            "choose": "\n".join(findInterfaces(wireless=False))
        }
        parameters = [
            ("device-input", _(MSG_GATEWAY_INTERNET), "combo", options_in),
            ("device-output", _(MSG_GATEWAY_HOME), "combo", options_out),
        ]
        return parameters

    def checkModule(self, parameters={}, quiet=False):
        pass

    def loadModule(self, parameters={}):
        # Initialize IPTables
        initializeIPTables()
        # Flush rules
        self.unloadModule()
        # Enable forwarding
        os.system("echo 1 > /proc/sys/net/ipv4/ip_forward")
        os.system("echo 1 > /proc/sys/net/ipv4/ip_dynaddr")
        # Load rules
        input = parameters.get("device-input", "")
        output = parameters.get("device-output", "")
        if input and output and input != output:
            in_name = input.split("_")[-1]
            out_name = output.split("_")[-1]
            execRule("-A PARDUS-FW-MOD-SHARING -i %s -o %s -m state --state ESTABLISHED,RELATED -j ACCEPT" % (in_name, out_name))
            execRule("-A PARDUS-FW-MOD-SHARING -i %s -o %s -j ACCEPT" % (out_name, in_name))
            execRule("-t nat -A PARDUS-POST-MOD-SHARING -o %s -j MASQUERADE" % in_name)
            # Create local NAT profile
            import comar
            link = comar.Link()
            package, connection = findOrCreateConnection(link, output)
            link.Network.Link[package].setState(connection, "up")
            # Configure DHCP
            makeDHCPConf(out_name)
            # Start DHCP
            startService("dhcpd", restart=True)

    def unloadModule(self, shutdown=False):
        # Stop DHCP
        stopService("dhcpd")
        if not shutdown:
            # Unload rules
            execRule("-F PARDUS-FW-MOD-SHARING")
            execRule("-P PARDUS-FW-MOD-SHARING ACCEPT")
            execRule("-t nat -F PARDUS-POST-MOD-SHARING")

# Usable modules
MODULES = {
    "internet_sharing": InternetSharingModule,
    "block_incoming": BlockIncoming,
    "block_outgoing": BlockOutgoing,
}

# Network.Firewall model

def listModules():
    return MODULES.keys()

def moduleInfo(module):
    inst = MODULES[module]()
    return inst.getInfo()

def moduleParameters(module):
    inst = MODULES[module]()
    return inst.getParameters()

def getModuleState(module):
    info = ModuleConfig(module).info
    return info.get("state", "off")

def setModuleState(name, state):
    if state in ["on", "off"]:
        # Save state
        module = ModuleConfig(name)
        module.info["state"] = state
        module.save()
        # Execute module if firewall is active
        if getState() == "on":
            inst = MODULES[name]()
            if state == "on":
                inst.loadModule(getModuleParameters(name))
            else:
                inst.unloadModule()
        # Notify clients
        notify("Network.Firewall", "moduleStateChanged", (name, state))

def getModuleParameters(module):
    info = ModuleConfig(module).info
    return info

def setModuleParameters(name, parameters):
    # Save module parameters
    module = ModuleConfig(name)
    for key, value in parameters.iteritems():
        module.info[key] = value
    module.save()
    # Execute module if it's active
    if getState() == "on" and getModuleState(name) == "on":
        inst = MODULES[name]()
        inst.checkModule(parameters)
        inst.loadModule(parameters)
    # Notify clients
    notify("Network.Firewall", "moduleSettingsChanged", (name))

def getState():
    state = ModuleConfig("general").info.get("state", "off")
    if state not in ["on", "off"] or not getServiceState(script()):
        return "off"
    return state

def setState(state):
    if state in ["on", "off"]:
        # Save state
        general = ModuleConfig("general")
        general.info["state"] = state
        general.save()
        if state == "on":
            # Start IPTables
            startService(script(), auto_start=True)
            # Execute active modules
            for module in listModuleConfigs():
                if module not in MODULES:
                    continue
                info = ModuleConfig(module).info
                if info.get("state", "off") == "on":
                    inst = MODULES[module]()
                    inst.loadModule(getModuleParameters(module))
        else:
            # Flush IPTables since every module depends on it
            netfilterutils.clear()
            # Stop IPTables
            stopService(script(), permanent=True)
            # Unload modules
            for module in listModuleConfigs():
                if module not in MODULES:
                    continue
                inst = MODULES[module]()
                inst.unloadModule(shutdown=True)
        # Notify clients
        notify("Network.Firewall", "stateChanged", (state))


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

from comar.service import *

serviceType = "local"
serviceDesc = _({"en": "Firewall",
                 "tr": "Güvenlik Duvarı"})

LOCK_FILE = "/var/lock/subsys/iptables"
FIREWALL_PATH = "/etc/firewall.conf"

import os
import pardus.netfilterutils as iptables
from pardus import iniutils

def writeFile(filename, content="", mode=0600):
    '''Writes content to filename and sets file mode.'''
    file(filename, "w").write(content)
    os.chmod(filename, mode)

def readFile(filename):
    """Return content of a file"""
    return file(filename, "r").read()

def startNetworkFirewall():
    INI = iniutils.iniParser(FIREWALL_PATH)
    try:
        info = INI.getSection("general")
    except iniutils.iniParserError:
        return
    if info.get("state", "off") == "on":
        call(script(), "Network.Firewall", "setState", ("on"))

def stop():
    # Save rules
    writeFile("/var/lib/iptables/rules", iptables.getRules())

    # Clear chains & rules
    iptables.clear()

    # Remove lock file
    if os.access(LOCK_FILE, os.F_OK):
        os.unlink(LOCK_FILE)

    # Notify clients
    notify("System.Service", "Changed", (script(), "stopped"))

def start():
    # Clear chains & rules
    iptables.clear()

    # Load rules
    profile_file = "/var/lib/iptables/rules"
    if os.path.exists(profile_file):
        rules = readFile(profile_file)
        iptables.restoreRules(rules)

    # Create lock file
    writeFile(LOCK_FILE, "")

    # Initialize Network.Firewall, if necessary
    startNetworkFirewall()

    # Notify clients
    notify("System.Service", "Changed", (script(), "started"))

def status():
    return os.access(LOCK_FILE, os.F_OK)


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>iptables</Name>
        <Homepage>http://www.iptables.org/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        Firewall, NAT and packet mangling tools
        <Description>Contains iptables firewall, NAT and packet mangling tools.</Description>
        <Archive sha1sum="b2592490ca7a6c2cd0f069e167a4337c86acdf91" type="tarbz2">ftp://ftp.netfilter.org/pub/iptables/iptables-1.6.1.tar.bz2</Archive>
        <BuildDependencies>
            <Dependency>libnfnetlink-devel</Dependency>
        </BuildDependencies>
        <Patches>

        </Patches>
    </Source>

    <Package>
        <Name>iptables</Name>
        <RuntimeDependencies>
            <Dependency>libnfnetlink</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="executable">/sbin</Path>
            <Path fileType="library">/lib</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="config">/etc</Path>
            <Path fileType="data">/var</Path>
            <Path fileType="data">/usr/share/xtables</Path>
        </Files>
        <Provides>
            <COMAR script="service.py">System.Service</COMAR>
            <COMAR script="firewall.py">Network.Firewall</COMAR>
        </Provides>
    </Package>

    <Package>
        <Name>iptables-devel</Name>
        Development files for iptables
        <RuntimeDependencies>
            <Dependency release="current">iptables</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="library">/usr/lib/*.a</Path>
            <Path fileType="data">/usr/lib/pkgconfig</Path>
            <Path fileType="man">/usr/share/man/man3</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-01-29</Date>
            <Version>1.6.1</Version>
            <Comment>Version bump.</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.6.0</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-20</Date>
            <Version>1.6.0</Version>
            <Comment>First release</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>iptables</Name>
        Güvenlik duvarı, ağ adres çevrimi ve paket çevrimi aracı
        <Description xml:lang="tr">Iptables kural tabanlı gelişmiş güvenlik duvarı uygulamasıdır.</Description>
    </Source>

    <Package>
        <Name>iptables-devel</Name>
        iptables için geliştirme dosyaları
    </Package>
</PISI>


code:
<PISI>
    <Name>network.ftp</Name>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
from pisi.actionsapi import get

def setup():
    #shelltools.export("WXRC", "/usr/bin/wxrc")
    #shelltools.export("LDFLAGS", "%s -lpthread" % get.LDFLAGS())
    #pisitools.dosed("data/filezilla.desktop", "Icon=filezilla", "Icon=/usr/share/pixmaps/filezilla.png")
    autotools.configure("--disable-static \
                         --disable-manualupdatecheck \
                         --disable-autoupdatecheck \
                         --with-pugixml=builtin \
                         --prefix=/usr ")

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    # move fzdefaults.xml.example to /usr/share/filezilla
    pisitools.domove("/usr/share/filezilla/docs/fzdefaults.xml.example", "/usr/share/filezilla")
    pisitools.removeDir("/usr/share/filezilla/docs")

    pisitools.dodoc("ChangeLog", "README", "AUTHORS")


code:
--- data/filezilla.desktop.orig	2009-03-21 21:32:16.000000000 +0200
+++ data/filezilla.desktop	2009-03-22 00:02:49.000000000 +0200
@@ -3,9 +3,11 @@
 GenericName=FTP client
 GenericName[de]=FTP-Client
 GenericName[fr]=Client FTP
+GenericName[tr]=FTP istemcisi
 Comment=Download and upload files via FTP, FTPS and SFTP
 Comment[de]=Dateien über FTP, FTPS und SFTP übertragen
 Comment[fr]=Transférer des fichiers via FTP, FTPS et SFTP
+Comment[tr]=Dosyaları ftp, sftp, ftps ile gönderin ve indirin
 Exec=filezilla
 Terminal=false
 Icon=filezilla


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>filezilla</Name>
        <Homepage>http://filezilla-project.org/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <Icon>filezilla</Icon>
        <IsA>app:gui</IsA>
        <Summary>Simple FTP Client</Summary>
        <Description>Easy-to-use FTP Client which also supports SFTP.</Description>
        <Archive sha1sum="c8da156611e7f8017505f425496afe22456f4c9d" type="tarbz2">mirrors://sourceforge/filezilla/FileZilla_Client/3.25.2/FileZilla_3.25.2_src.tar.bz2</Archive>
        <BuildDependencies>
            <Dependency>libidn-devel</Dependency>
            <Dependency>dbus-devel</Dependency>
            <Dependency>sqlite-devel</Dependency>
            <Dependency>gnutls-devel</Dependency>
            <Dependency>gtk2-devel</Dependency>
            <Dependency>xdg-utils</Dependency>
            <Dependency>wxGTK-devel</Dependency>
            <Dependency>nettle-devel</Dependency>
            <Dependency>libfilezilla-devel</Dependency>
        </BuildDependencies>
        <Patches>
<!--             <Patch level="0">i18n-filezilla.desktop.patch</Patch> -->
        </Patches>
    </Source>

    <Package>
        <Name>filezilla</Name>
        <RuntimeDependencies>
            <Dependency>gtk2</Dependency>
            <Dependency>wxGTK</Dependency>
            <Dependency>dbus</Dependency>
            <Dependency>sqlite</Dependency>
            <Dependency>libgcc</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency>gnutls</Dependency>
            <Dependency>nettle</Dependency>
            <Dependency>xdg-utils</Dependency>
            <Dependency>libfilezilla</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="data">/usr/share/applications</Path>
            <Path fileType="data">/usr/share/filezilla</Path>
            <Path fileType="data">/usr/share/pixmaps</Path>
            <Path fileType="data">/usr/share/icons</Path>
            <Path fileType="localedata">/usr/share/locale</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="data">/usr/share/appdata/</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-05-25</Date>
            <Version>3.25.2</Version>
            <Comment>Version Bump</Comment>
            <Name>Kamil Atlı</Name>
            <Email>suvari@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>3.14.1</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-26</Date>
            <Version>3.14.1</Version>
            <Comment>First release</Comment>
            <Name>Alihan Öztürk</Name>
            <Email>alihan@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>filezilla</Name>
        <Summary xml:lang="tr">FTP ve SFTP istemcisi</Summary>
        <Description xml:lang="tr">Filezilla; dosyalarınızı ftp, sftp, ftps ile göndermenize ve indirmenize yarar</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt.

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

def setup():
    autotools.configure("--enable-packager-mode \
                         --with-modules \
                         --with-gnutls \
                         --disable-rpath \
                         --disable-static")

    pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc("AUTHORS", "ChangeLog", "README*", "NEWS", "FAQ", "FEATURES", "BUGS", "THANKS", "TODO")


code:
## lftp-config-dns-inet6_before_inet by Noèl Köthe <noel debian.org>
##
## DP: use inet6 dns before inet

--- lftp-3.4.7/lftp.conf.orig      2005-05-16 21:18:45.000000000 +0200
+++ lftp-3.4.7/lftp.conf   2005-05-16 21:19:06.000000000 +0200
@@ -87,3 +87,7 @@
 # set ftp:anon-pass "mozilla@"
 # set ftp:client ""
 # set http:user-agent "Mozilla/4.7 [en] (WinNT; I)"
+
+# try inet6 before inet
+set dns:order "inet6 inet"
+


code:
diff -up lftp-4.2.1/src/Http.cc.date_fmt lftp-4.2.1/src/Http.cc
--- lftp-4.2.1/src/Http.cc.date_fmt	2011-03-25 15:35:42.000000000 +0100
+++ lftp-4.2.1/src/Http.cc	2011-03-30 14:40:54.170096624 +0200
@@ -29,6 +29,7 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <time.h>
+#include <limits.h>
 #include <fnmatch.h>
 #include <locale.h>
 #include <assert.h>
@@ -565,15 +566,10 @@ void Http::SendRequest(const char *conne
 		     (long long)((limit==FILE_END || limit>entity_size ? entity_size : limit)-1),
 		     (long long)entity_size);
       }
-      if(entity_date!=NO_DATE)
+      if(entity_date!=NO_DATE && entity_date>0L && entity_date<INT_MAX)
       {
-	 static const char weekday_names[][4]={
-	    "Sun","Mon","Tue","Wed","Thu","Fri","Sat"
-	 };
-	 const struct tm *t=gmtime(&entity_date);
-	 const char *d=xstring::format("%s, %2d %s %04d %02d:%02d:%02d GMT",
-	    weekday_names[t->tm_wday],t->tm_mday,month_names[t->tm_mon],
-	    t->tm_year+1900,t->tm_hour,t->tm_min,t->tm_sec);
+         char d[256];
+         strftime(d, sizeof(d), "%a, %d %b %H:%M:%S %Y GMT", gmtime(&entity_date));
 	 Send("Last-Modified: %s\r\n",d);
       }
       break;


code:
--- lftp-2.2.0a/lftpget.1.chmou	Tue May  5 13:32:27 1998
+++ lftp-2.2.0a/lftpget.1	Wed Mar 29 17:50:36 2000
@@ -0,0 +1,74 @@
+.\"
+.\" lftpget.1 - gets files via FTP using lftp
+.\"
+.\" This file is part of lftp.
+.\"
+.\" This program is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License , or
+.\" (at your option) any later version.
+.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program; see the file COPYING.  If not, write to
+.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+.\"
+.TH lftpget 1 "11 Sep 1999"
+.SH NAME
+lftpget \- gets files via FTP using lftp
+.SH SYNTAX
+.BI "lftpget [" \-c "] [" \-d "] [" \-v "] " "URL " [ URL ...]
+
+.SH "DESCRIPTION"
+.B lftpget
+will get a file from a remote host. It will reconnect if needed until
+the transfer is done.
+.PP
+.B lftpget
+is just a shell script that calls
+.BR lftp (1).
+
+.SH OPTIONS
+.TP
+.B \-c
+Continue a previous transfer, reget.
+.TP
+.B \-d
+Debug output.
+.TP
+.B \-v
+Verbose output.
+
+.SH FILES
+.TP
+.I "/etc/lftp.conf"
+System wide startup file for lftp, affects this script.
+
+.TP
+.I "~/.lftp/rc," "~/.lftprc"
+These files are executed on lftp startup after \fI/etc/lftp.conf\fR.
+.TP
+.I "~/.lftp/log"
+The file things are logged to when lftp moves into the background in
+nohup mode.
+.TP
+.I "~/.netrc"
+
+The file is consulted to get default login to ftp server. It's
+documented in the
+.BR ftp (1)
+manpage.
+
+.SH SEE ALSO
+.BR ftp "(1), " lftp (1)
+
+.SH AUTHOR
+Alexander V. Lukyanov <lav@yars.free.net>
+
+.SH ACKNOWLEDGMENTS
+This manual page was originally written by Nicol�s Lichtmaier
+<nick@debian.org>, for the Debian GNU/Linux system.


code:
--- lftp-3.7.7/lftp.conf.agent	2008-08-07 14:27:47.000000000 +0200
+++ lftp-3.7.7/lftp.conf	2009-01-12 14:21:24.000000000 +0100
@@ -13,7 +13,7 @@
 ## Uncomment the following two lines to make switch cls and ls, making
 ## cls the default.
 #alias ls command cls
-#alias hostls command ls
+alias hostls command ls

 ## default protocol selection
 #set default-protocol/ftp.*	ftp
@@ -31,7 +31,7 @@
 set auto-sync-mode "icrosoft FTP Service|MadGoat|MikroTik"

 ## if default ftp passive mode does not work, try this:
-# set ftp:passive-mode off
+set ftp:passive-mode on

 ## Set this to follow http redirections
 set xfer:max-redirections 10
@@ -87,4 +87,4 @@
 ## If you don't like advertising lftp or servers hate it, set this:
 # set ftp:anon-pass "mozilla@"
 # set ftp:client ""
-# set http:user-agent "Mozilla/4.7 [en] (WinNT; I)"
+# set http:user-agent "Mozilla/4.7 [en] (Linux; U)"


code:
--- lftp-4.2.0/src/Makefile.am.link	2011-03-05 13:59:13.000000000 +0100
+++ lftp-4.2.0/src/Makefile.am	2011-03-05 13:59:33.000000000 +0100
@@ -55,8 +55,8 @@
 cmd_mirror_la_LDFLAGS = -module -avoid-version -rpath $(pkgverlibdir)
 cmd_sleep_la_LDFLAGS  = -module -avoid-version -rpath $(pkgverlibdir)
 cmd_torrent_la_LDFLAGS= -module -avoid-version -rpath $(pkgverlibdir)
-liblftp_pty_la_LDFLAGS     = -avoid-version -rpath $(pkgverlibdir)
-liblftp_network_la_LDFLAGS = -avoid-version -rpath $(pkgverlibdir) $(OPENSSL_LDFLAGS)
+liblftp_pty_la_LDFLAGS     = -module -avoid-version -rpath $(pkgverlibdir)
+liblftp_network_la_LDFLAGS = -module -avoid-version -rpath $(pkgverlibdir) $(OPENSSL_LDFLAGS)
 liblftp_network_la_LIBADD  = $(SOCKSLIBS) $(OPENSSL_LIBS) $(LIBGNUTLS_LIBS) $(GNULIB)

 proto_ftp_la_LIBADD  = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la
--- lftp-4.2.0/src/Makefile.in.link	2011-03-05 13:59:48.000000000 +0100
+++ lftp-4.2.0/src/Makefile.in	2011-03-05 14:00:18.000000000 +0100
@@ -1286,8 +1286,8 @@
 cmd_mirror_la_LDFLAGS = -module -avoid-version -rpath $(pkgverlibdir)
 cmd_sleep_la_LDFLAGS = -module -avoid-version -rpath $(pkgverlibdir)
 cmd_torrent_la_LDFLAGS = -module -avoid-version -rpath $(pkgverlibdir)
-liblftp_pty_la_LDFLAGS = -avoid-version -rpath $(pkgverlibdir)
-liblftp_network_la_LDFLAGS = -avoid-version -rpath $(pkgverlibdir) $(OPENSSL_LDFLAGS)
+liblftp_pty_la_LDFLAGS = -module -avoid-version -rpath $(pkgverlibdir)
+liblftp_network_la_LDFLAGS = -module -avoid-version -rpath $(pkgverlibdir) $(OPENSSL_LDFLAGS)
 liblftp_network_la_LIBADD = $(SOCKSLIBS) $(OPENSSL_LIBS) $(LIBGNUTLS_LIBS) $(GNULIB)
 proto_ftp_la_LIBADD = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la
 proto_http_la_LIBADD = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la $(EXPAT_LIBS)


code:
Description: prevent sys/_stdint.h from redefining intptr_t et.al.
Author: Andreas Henriksson <andreas@fatal.se>
Bug-Debian: http://bugs.debian.org/677861
Forwarded: no

--- lftp-4.3.6.orig/lib/stdint.in.h
+++ lftp-4.3.6/lib/stdint.in.h
@@ -75,6 +75,10 @@
      _@GUARD_PREFIX@_STDINT_H is defined.
      The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#ifdef __FreeBSD_kernel__
+// prevent sys/_stdint.h from being included and redefine intptr_t et.al.
+#define _SYS__STDINT_H_
+#endif
 #endif

 #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H