[kicad/rawhide/user/lkundrak/fp-lib] Install library footprints

Lubomir Rintel lkundrak at fedoraproject.org
Sun Nov 30 15:10:03 UTC 2014


commit 65cfaf04caf142f60f5633d163c853a3969a1dba
Author: Lubomir Rintel <lkundrak at v3.sk>
Date:   Sun Nov 30 15:46:30 2014 +0100

    Install library footprints

 .gitignore                    |    1 +
 kicad-2014.03.13-fp-lib.patch |   55 +++++++++++++++++++++++++++++++++++++++++
 kicad-clone.sh                |   11 ++++++++
 kicad-export.sh               |   28 +++++++++++++++++++++
 kicad-update.sh               |   33 +++++++++++++++++++-----
 kicad.spec                    |   19 ++++++++++++-
 sources                       |    1 +
 7 files changed, 139 insertions(+), 9 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c6a6e08..b6a2630 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,4 @@ kicad-libraries-2010.05.27.tar.bz2
 /kicad-libraries-2014.03.13.tar.xz
 /kicad-doc-2014.03.13.tar.xz
 /kicad-walter-libraries-2014.03.13.tar.xz
+/kicad-footprints-2014.03.13.tar.xz
diff --git a/kicad-2014.03.13-fp-lib.patch b/kicad-2014.03.13-fp-lib.patch
new file mode 100644
index 0000000..c2df551
--- /dev/null
+++ b/kicad-2014.03.13-fp-lib.patch
@@ -0,0 +1,55 @@
+From 4679051cd0ff68d902705fcba5b0ee7940fdbaa1 Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak at v3.sk>
+Date: Sun, 30 Nov 2014 14:19:30 +0100
+Subject: [PATCH] Remove Capacitors.pretty and Iut.pretty from the footprint
+ library
+
+They've been removed from GitHub and we don't have a snapshot :(
+---
+ template/fp-lib-table.for-github | 2 --
+ template/fp-lib-table.for-pretty | 2 --
+ 2 files changed, 4 deletions(-)
+
+diff --git a/template/fp-lib-table.for-github b/template/fp-lib-table.for-github
+index fd9cd16..46bce09 100644
+--- a/template/fp-lib-table.for-github
++++ b/template/fp-lib-table.for-github
+@@ -5,7 +5,6 @@
+   (lib (name Capacitors_SMD)(type Github)(uri ${KIGITHUB}/Capacitors_SMD.pretty)(options "")(descr "The way you like them."))
+   (lib (name Capacitors_Tantalum_SMD)(type Github)(uri ${KIGITHUB}/Capacitors_Tantalum_SMD.pretty)(options "")(descr "The way you like them."))
+   (lib (name Capacitors_ThroughHole)(type Github)(uri ${KIGITHUB}/Capacitors_ThroughHole.pretty)(options "")(descr "The way you like them."))
+-  (lib (name Capacitors)(type Github)(uri ${KIGITHUB}/Capacitors.pretty)(options "")(descr "The way you like them."))
+   (lib (name Choke_Axial_ThroughHole)(type Github)(uri ${KIGITHUB}/Choke_Axial_ThroughHole.pretty)(options "")(descr "The way you like them."))
+   (lib (name Choke_Common-Mode_Wurth)(type Github)(uri ${KIGITHUB}/Choke_Common-Mode_Wurth.pretty)(options "")(descr "The way you like them."))
+   (lib (name Choke_Radial_ThroughHole)(type Github)(uri ${KIGITHUB}/Choke_Radial_ThroughHole.pretty)(options "")(descr "The way you like them."))
+@@ -40,7 +39,6 @@
+   (lib (name Inductors_NEOSID)(type Github)(uri ${KIGITHUB}/Inductors_NEOSID.pretty)(options "")(descr "The way you like them."))
+   (lib (name Inductors)(type Github)(uri ${KIGITHUB}/Inductors.pretty)(options "")(descr "The way you like them."))
+   (lib (name IR-DirectFETs)(type Github)(uri ${KIGITHUB}/IR-DirectFETs.pretty)(options "")(descr "The way you like them."))
+-  (lib (name Iut)(type Github)(uri ${KIGITHUB}/Iut.pretty)(options "")(descr "The way you like them."))
+   (lib (name Labels)(type Github)(uri ${KIGITHUB}/Labels.pretty)(options "")(descr "The way you like them."))
+   (lib (name LEDs)(type Github)(uri ${KIGITHUB}/LEDs.pretty)(options "")(descr "The way you like them."))
+   (lib (name Measurement_Points)(type Github)(uri ${KIGITHUB}/Measurement_Points.pretty)(options "")(descr "The way you like them."))
+diff --git a/template/fp-lib-table.for-pretty b/template/fp-lib-table.for-pretty
+index 4c3da38..edcb72d 100644
+--- a/template/fp-lib-table.for-pretty
++++ b/template/fp-lib-table.for-pretty
+@@ -5,7 +5,6 @@
+   (lib (name Capacitors_SMD)(type KiCad)(uri ${KISYSMOD}/Capacitors_SMD.pretty)(options "")(descr "The way you like them."))
+   (lib (name Capacitors_Tantalum_SMD)(type KiCad)(uri ${KISYSMOD}/Capacitors_Tantalum_SMD.pretty)(options "")(descr "The way you like them."))
+   (lib (name Capacitors_ThroughHole)(type KiCad)(uri ${KISYSMOD}/Capacitors_ThroughHole.pretty)(options "")(descr "The way you like them."))
+-  (lib (name Capacitors)(type KiCad)(uri ${KISYSMOD}/Capacitors.pretty)(options "")(descr "The way you like them."))
+   (lib (name Choke_Axial_ThroughHole)(type KiCad)(uri ${KISYSMOD}/Choke_Axial_ThroughHole.pretty)(options "")(descr "The way you like them."))
+   (lib (name Choke_Common-Mode_Wurth)(type KiCad)(uri ${KISYSMOD}/Choke_Common-Mode_Wurth.pretty)(options "")(descr "The way you like them."))
+   (lib (name Choke_Radial_ThroughHole)(type KiCad)(uri ${KISYSMOD}/Choke_Radial_ThroughHole.pretty)(options "")(descr "The way you like them."))
+@@ -40,7 +39,6 @@
+   (lib (name Inductors_NEOSID)(type KiCad)(uri ${KISYSMOD}/Inductors_NEOSID.pretty)(options "")(descr "The way you like them."))
+   (lib (name Inductors)(type KiCad)(uri ${KISYSMOD}/Inductors.pretty)(options "")(descr "The way you like them."))
+   (lib (name IR-DirectFETs)(type KiCad)(uri ${KISYSMOD}/IR-DirectFETs.pretty)(options "")(descr "The way you like them."))
+-  (lib (name Iut)(type KiCad)(uri ${KISYSMOD}/Iut.pretty)(options "")(descr "The way you like them."))
+   (lib (name Labels)(type KiCad)(uri ${KISYSMOD}/Labels.pretty)(options "")(descr "The way you like them."))
+   (lib (name LEDs)(type KiCad)(uri ${KISYSMOD}/LEDs.pretty)(options "")(descr "The way you like them."))
+   (lib (name Measurement_Points)(type KiCad)(uri ${KISYSMOD}/Measurement_Points.pretty)(options "")(descr "The way you like them."))
+-- 
+2.1.0
+
diff --git a/kicad-clone.sh b/kicad-clone.sh
index d6ac8ec..04a3a70 100755
--- a/kicad-clone.sh
+++ b/kicad-clone.sh
@@ -1,4 +1,15 @@
 #!/bin/sh
+set -e
+
 bzr checkout lp:kicad kicad.bzr
 bzr checkout lp:~kicad-product-committers/kicad/library kicad-library.bzr
 bzr branch --stacked lp:~kicad-developers/kicad/doc kicad-doc.bzr
+
+fps () { sed -n 's|.*\${KIGITHUB}/\([^)]*\)).*|\1|p'  kicad-library.bzr/template/fp-lib-table.for-github }
+
+mkdir -p footprints
+fps |while read FP
+	do
+		git clone https://github.com/KiCad/$FP footprints/$FP ||
+			print "$FP missing, possibly gone from GitHub now"
+	done
diff --git a/kicad-export.sh b/kicad-export.sh
index b680b92..c1b2994 100755
--- a/kicad-export.sh
+++ b/kicad-export.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+set -e
+
 TIMESTAMP="2014.03.13"
 MAIN_REV=4744
 LIB_REV=333
@@ -16,4 +18,30 @@ cd ../kicad-doc.bzr
 bzr export -r $DOC_REV kicad-doc-$TIMESTAMP
 echo "Creating kicad-doc-$TIMESTAMP.tar.xz ..."
 tar cJf kicad-doc-$TIMESTAMP.tar.xz kicad-doc-$TIMESTAMP
+cd ../footprints
+echo "Creating kicad-footprints-$TIMESTAMP.tar.xz ..."
+rm -rf kicad-footprints-$TIMESTAMP
+mkdir -p kicad-footprints-$TIMESTAMP
+>kicad-footprints-$TIMESTAMP/VERSIONS.footprints
+sed -n 's|.*\${KIGITHUB}/\([^)]*\)).*|\1|p' \
+	../kicad-library.bzr/kicad-libraries-$TIMESTAMP/template/fp-lib-table.for-github |
+	while read FP
+	do
+		if [ -d $FP ]
+		then
+			cd $FP
+			REV=$(git rev-list -n 1 --before="$TIMESTAMP" master)
+			if [ -z $REV ]
+			then
+				echo "$FP did not exist at $TIMESTAMP!"
+				REV=$(git rev-list -n 1 master)
+			fi
+			git archive --prefix=$FP/ $REV |tar xf - -C ../kicad-footprints-$TIMESTAMP
+			echo $FP $REV >>../kicad-footprints-$TIMESTAMP/VERSIONS.footprints
+			cd ..
+		else
+			echo "$FP missing now. Update libraries snapshot or patch it away from fp-lib-table!"
+		fi
+	done
+tar -cJf kicad-footprints-$TIMESTAMP.tar.xz kicad-footprints-$TIMESTAMP
 cd ..
diff --git a/kicad-update.sh b/kicad-update.sh
index 5ce43df..931640a 100755
--- a/kicad-update.sh
+++ b/kicad-update.sh
@@ -1,8 +1,27 @@
 #!/bin/sh
-cd kicad.bzr
-bzr update
-cd ../kicad-library.bzr
-bzr update
-cd ../kicad-doc.bzr
-bzr update
-cd ..
+set -e
+
+fps () { sed -n 's|.*\${KIGITHUB}/\([^)]*\)).*|\1|p' \
+	kicad-library.bzr/template/fp-lib-table.for-github \
+	kicad-library.bzr/kicad-libraries-*/template/fp-lib-table.for-github
+}
+
+# Deleted footprints
+(fps; fps; ls footprints) |sort |uniq -u |while read FP
+do
+	rm -r footprints/$FP
+done
+
+# Update existing ones
+fps |while read FP
+do
+	if [ -d footprints/$FP ]
+	then
+		cd footprints/$FP
+		git pull
+		cd ../..
+	else
+		git clone https://github.com/KiCad/$FP footprints/$FP ||
+			print "$FP missing, possibly gone from GitHub now"
+	fi
+done
diff --git a/kicad.spec b/kicad.spec
index 3e15fc4..1436c49 100644
--- a/kicad.spec
+++ b/kicad.spec
@@ -1,6 +1,6 @@
 Name:           kicad
 Version:        2014.03.13
-Release:        8.rev4744%{?dist}
+Release:        9.rev4744%{?dist}
 Summary:        Electronic schematic diagrams and printed circuit board artwork
 Summary(fr):    Saisie de schéma électronique et routage de circuit imprimé
 
@@ -21,11 +21,13 @@ URL:            http://www.kicad-pcb.org
 Source:         %{name}-%{version}.tar.xz
 Source1:        %{name}-doc-%{version}.tar.xz
 Source2:        %{name}-libraries-%{version}.tar.xz
+Source3:        %{name}-footprints-%{version}.tar.xz
 Source7:        Epcos-MKT-1.0.tar.bz2
 Source8:        %{name}-walter-libraries-%{version}.tar.xz
 
 Patch0:         pcb_calculator-desktop-fix.patch
 Patch1:         kicad-2014.03.13-nostrip.patch
+Patch2:         kicad-2014.03.13-fp-lib.patch
 
 BuildRequires:  desktop-file-utils
 BuildRequires:  wxGTK-devel
@@ -178,11 +180,15 @@ Documentation and tutorials for Kicad in Chinese
 
 
 %prep
-%setup -q -a 1 -a 2 -a 7 -a 8
+%setup -q -a 1 -a 2 -a 3 -a 7 -a 8
 
 %patch0 -p1
 %patch1 -p1
 
+cd %{name}-libraries-%{version}
+%patch2 -p1
+cd ..
+
 #kicad-doc.noarch: W: file-not-utf8 /usr/share/doc/kicad/AUTHORS.txt
 iconv -f iso8859-1 -t utf-8 AUTHORS.txt > AUTHORS.conv && mv -f AUTHORS.conv AUTHORS.txt
 
@@ -259,6 +265,12 @@ popd
 install -d %{buildroot}%{_datadir}/%{name}/template
 install -m 644 template/%{name}.pro %{buildroot}%{_datadir}/%{name}/template
 
+# Footprints
+pushd %{name}-footprints-%{version}/
+cp -a */ %{buildroot}%{_datadir}/%{name}/modules
+popd
+ln -f %{buildroot}%{_datadir}/%{name}/template/fp-lib-table{.for-pretty,}
+
 # Preparing for documentation pull-ups
 %{__rm} -f  %{name}-doc-%{version}/doc/help/CMakeLists.txt
 %{__rm} -f  %{name}-doc-%{version}/doc/help/makefile
@@ -355,6 +367,9 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
 
 
 %changelog
+* Sun Nov 30 2014 Lubomir Rintel <lkundrak at v3.sk> - 2014.03.13-9.rev4744
+- Install library footprints
+
 * Mon Aug 18 2014 Rex Dieter <rdieter at fedoraproject.org> 2014.03.13-8.rev4744
 - update mime scriptlets
 
diff --git a/sources b/sources
index b26321c..d92675d 100644
--- a/sources
+++ b/sources
@@ -1,5 +1,6 @@
 f0a45487c81db32d7c97ea0fb59fc7d4  kicad-2014.03.13.tar.xz
 1e8870c0b80a9526b5285e5c90dead50  kicad-libraries-2014.03.13.tar.xz
 b886bbec5fc0e05f0d9a5d4f35119577  kicad-doc-2014.03.13.tar.xz
+4dd1da93067020c2ac690876a5e361a2  kicad-footprints-2014.03.13.tar.xz
 7d6f1b15a2ef24b77ac5982c06d889e6  kicad-walter-libraries-2014.03.13.tar.xz
 4dba5eca85fcec9bba491c1815963f80  Epcos-MKT-1.0.tar.bz2


More information about the scm-commits mailing list