-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheagle_package_release
executable file
·102 lines (90 loc) · 3.49 KB
/
eagle_package_release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
#########################################################################
#
# usage: ./eagle_package_release board_name [version]
#
# running this script will generate an electronics release file suitable for release on sourceforge and for production use.
# it will produce the following files in a .zip file:
#
# * gerber
# * postscript
# * pdf
# * png
# * povray render
#
# installation / required tools:
#
# this script is for linux. recommend using Ubuntu.
#
# *eagle*
# you must have eagle in your path somewhere. we recommend using the latest version
# download here: http://www.cadsoft.de/download.htm
# (dont forget to add it to your $PATH in ~/.bashrc)
#
# *povray*
# this is the 3D rendering engine. its pretty easy to install:
# sudo apt-get install povray povray-includes
#
# example install:
# wget ftp://ftp.cadsoft.de/eagle/program/6.2/eagle-lin-6.2.0.run
# sh ./eagle-lin-6.2.0.run ~
# echo "export PATH=\"\$PATH:~/eagle-6.2.0/bin\"" >> ~/.bashrc
# source ~/.bashrc
#
#########################################################################
#init up
BOARD=`basename $1`
VERSION=${2:-`date +%Y-%m-%d`}
TO_DIR="hoektronics-$BOARD-$VERSION"
FILELIST=""
#directory structure
echo "Making Files..."
mkdir -p "$TO_DIR"
mkdir -p "$TO_DIR/gerber"
mkdir -p "$TO_DIR/eagle"
#create our gerber files!
echo "Creating Gerber Files..."
eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/TopCopperLayer.gtl" $BOARD/*.brd Top Pads Vias
eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/TopSolderMask.gts" $BOARD/*.brd tStop
eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/TopSilkScreen.gto" $BOARD/*.brd Dimension tPlace tDocu tValues tNames
eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/TopSolderPaste.gtp" $BOARD/*.brd Dimension tCream
eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/BottomCopperLayer.gbl" $BOARD/*.brd Bottom Pads Vias
eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/BottomSolderMask.gts" $BOARD/*.brd bStop
eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/BottomSilkScreen.gbo" $BOARD/*.brd Dimension bPlace bDocu bValues bNames
eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/BottomSolderPaste.gbp" $BOARD/*.brd Dimension bCream
#eagle -X -N -d GERBER_RS274X -o "$TO_DIR/gerber/FabDrawing.pho" $BOARD/*.brd Dimension tPlace tOrigins tNames tValues tCream Holes Document Reference tDocu
# Drill data for NC drill st.
# warning : eagle takes path of -R option from input file directory.
eagle -X -N -d EXCELLON -E -0.02 -E 0.1 -R ${BOARD}.drl -o $TO_DIR/gerber/${BOARD}.drd ${BOARD}/*.brd Drills Holes
cp $BOARD/*.drl $TO_DIR/gerber
#clean up the process
rm -rf $TO_DIR/gerber/*.gpi
rm -rf $TO_DIR/gerber/*.dri
#render our board with POVRay and eagle3d - high quality
if [ -f ${BOARD}/${BOARD}.pov ]
then
echo "Rendering board with eagle3D and POVRay..."
#eagle -X -N -d eagle3D/ulp/3d41.ulp -o "$TO_DIR/renders/render.pov" $BOARD/*.brd
povray eagle3D/render.ini +I${BOARD}/${BOARD}.pov +O${TO_DIR}${BOARD}.png +FN +W1200 +H1024 +Q9 +A +AM2 -D -V +WL0
#cp ${BOARD}/*.pov ${TO_DIR}/renders
else
echo "No .pov file found, not rendering 3D version of board."
fi
#create our source dir
cp $BOARD/*.brd "$TO_DIR/eagle/";
cp $BOARD/*.sch "$TO_DIR/eagle/";
#copy any docs over
cp $BOARD/*.rtf "$TO_DIR/";
cp $BOARD/*.pdf "$TO_DIR/";
cp $BOARD/*.txt "$TO_DIR/";
cp $BOARD/*.doc "$TO_DIR/";
cp $BOARD/*.csv "$TO_DIR/";
cp $BOARD/*.xls "$TO_DIR/";
#create our archive
echo "Archiving..."
zip -qr "$TO_DIR.zip" "$TO_DIR"
#cleanup
echo "Cleanup..."
rm -rf "$TO_DIR"
#done!
echo "Release v$VERSION created as ${TO_DIR}.zip"