Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
make suck less
Browse files Browse the repository at this point in the history
Now with less suckage!
Oh, and really, add the install recipes, distinguishing in the
filenames how they inherited their info, and fixed lack of unarchiving
that I thought the download step was going to do for me, forgetting it
purge’s destinations on purpose.
  • Loading branch information
arubdesu committed Nov 17, 2014
1 parent 00844e1 commit 223853c
Show file tree
Hide file tree
Showing 5 changed files with 322 additions and 206 deletions.
73 changes: 73 additions & 0 deletions installRecipeGenerator-dmgdwnldParent.py
@@ -0,0 +1,73 @@
#!/usr/bin/env python
#
# Copyright 2014 Allister Banks (see end for license)
#
import sys, os
template_string = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Installs the current release version of %producto%.</string>
<key>Identifier</key>
<string>com.github.autopkg.install.%producto%</string>
<key>Input</key>
<dict>
<key>Name</key>
<string>%producto%</string>
</dict>
<key>MinimumVersion</key>
<string>0.4.0</string>
<key>ParentRecipe</key>
<string>com.github.autopkg.download.%producto%</string>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>InstallFromDMG</string>
<key>Arguments</key>
<dict>
<key>dmg_path</key>
<string>%pathname%</string>
<key>items_to_copy</key>
<array>
<dict>
<key>source_item</key>
<string>%producto%.app</string>
<key>destination_path</key>
<string>/Applications/</string>
</dict>
</array>
</dict>
</dict>
</array>
</dict>
</plist>
"""

products = [
"LibreOffice",
"TeamViewerQS"
]

filename = "/tmp/scratch"
for product_name in products:
new_string = template_string.replace("%producto%", product_name)
target = open(filename, 'w')
target.write(new_string)
target.close()
os.rename(filename, "/tmp/" + product_name + ".install.recipe")

print "Ding! Fries are done."

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Expand Up @@ -13,44 +13,35 @@
<string>com.github.autopkg.install.%producto%</string>
<key>Input</key>
<dict>
<key>Name</key>
<string>%producto%</string>
</dict>
<key>MinimumVersion</key>
<string>0.4.0</string>
<key>ParentRecipe</key>
<string>com.github.autopkg.download.%producto%</string>
<string>com.github.autopkg.pkg.%producto%</string>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>InstallFromDMG</string>
<key>Arguments</key>
<dict>
<key>dmg_path</key>
<string>%pathname%</string>
<key>items_to_copy</key>
<array>
<dict>
<key>source_item</key>
<string>%producto%.app</string>
<key>destination_path</key>
<string>/Applications/</string>
</dict>
</array>
</dict>
<string>Installer</string>
</dict>
</array>
</dict>
</plist>
"""

products = [
"ClipMenu",
"Pacifist",
"Reflector",
"Isolator",
"Workshare",
"Bartender",
"Fake",
"Fluid",
"Cinch",
"iTeleport",
"Limechat",
"Mactracker",
"MSLync",
"OnCue2",
"LingonX",
"quickradar",
"MarsEdit",
]

filename = "/tmp/scratch"
Expand Down
58 changes: 58 additions & 0 deletions installRecipeGenerator-pkgdwnldParent.py
@@ -0,0 +1,58 @@
#!/usr/bin/env python
#
# Copyright 2014 Allister Banks (see end for license)
#
import sys, os
template_string = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Installs the current release version of %producto%.</string>
<key>Identifier</key>
<string>com.github.autopkg.install.%producto%</string>
<key>Input</key>
<dict>
</dict>
<key>MinimumVersion</key>
<string>0.4.0</string>
<key>ParentRecipe</key>
<string>com.github.autopkg.download.%producto%</string>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>Installer</string>
</dict>
</array>
</dict>
</plist>
"""

products = [
"iLokLicenseManager",
"Packages",
"R"
]

filename = "/tmp/scratch"
for product_name in products:
new_string = template_string.replace("%producto%", product_name)
target = open(filename, 'w')
target.write(new_string)
target.close()
os.rename(filename, "/tmp/" + product_name + ".install.recipe")

print "Ding! Fries are done."

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
175 changes: 80 additions & 95 deletions pkgRecipeGenerator-dmg.py
Expand Up @@ -7,106 +7,91 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Downloads the current release version of %producto% and builds a package.</string>
<key>Identifier</key>
<string>com.github.autopkg.pkg.%producto%</string>
<key>Input</key>
<dict>
<key>NAME</key>
<string>%producto%</string>
</dict>
<key>ParentRecipe</key>
<string>com.github.autopkg.download.%producto%</string>
<key>MinimumVersion</key>
<string>0.2.0</string>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>AppDmgVersioner</string>
<key>Arguments</key>
<dict>
<key>dmg_path</key>
<string>%pathname%</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgRootCreator</string>
<key>Arguments</key>
<dict>
<key>pkgroot</key>
<string>%RECIPE_CACHE_DIR%/%NAME%</string>
<key>pkgdirs</key>
<dict>
<key>Applications</key>
<string>0775</string>
</dict>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>Copier</string>
<key>Arguments</key>
<dict>
<key>source_path</key>
<string>%pathname%/%producto%.app</string>
<key>destination_path</key>
<string>%pkgroot%/Applications/%producto%.app</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgCreator</string>
<key>Arguments</key>
<dict>
<key>pkgname</key>
<string>%NAME%-%version%</string>
<key>pkg_request</key>
<dict>
<key>pkgdir</key>
<string>%RECIPE_CACHE_DIR%</string>
<key>id</key>
<string>%id%</string>
<key>options</key>
<string>purge_ds_store</string>
<key>chown</key>
<array>
<dict>
<key>path</key>
<string>Applications</string>
<key>user</key>
<string>root</string>
<key>group</key>
<string>admin</string>
</dict>
</array>
</dict>
</dict>
</dict>
</array>
<key>Description</key>
<string>Downloads the current release version of %producto% and builds a package.</string>
<key>Identifier</key>
<string>com.github.autopkg.pkg.%producto%</string>
<key>Input</key>
<dict>
<key>NAME</key>
<string>%producto%</string>
</dict>
<key>ParentRecipe</key>
<string>com.github.autopkg.download.%producto%</string>
<key>MinimumVersion</key>
<string>0.2.0</string>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>AppDmgVersioner</string>
<key>Arguments</key>
<dict>
<key>dmg_path</key>
<string>%pathname%</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgRootCreator</string>
<key>Arguments</key>
<dict>
<key>pkgroot</key>
<string>%RECIPE_CACHE_DIR%/%NAME%</string>
<key>pkgdirs</key>
<dict>
<key>Applications</key>
<string>0775</string>
</dict>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>Copier</string>
<key>Arguments</key>
<dict>
<key>source_path</key>
<string>%pathname%/%producto%.app</string>
<key>destination_path</key>
<string>%pkgroot%/Applications/%producto%.app</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgCreator</string>
<key>Arguments</key>
<dict>
<key>pkgname</key>
<string>%NAME%-%version%</string>
<key>pkg_request</key>
<dict>
<key>pkgdir</key>
<string>%RECIPE_CACHE_DIR%</string>
<key>id</key>
<string>%id%</string>
<key>options</key>
<string>purge_ds_store</string>
<key>chown</key>
<array>
<dict>
<key>path</key>
<string>Applications</string>
<key>user</key>
<string>root</string>
<key>group</key>
<string>admin</string>
</dict>
</array>
</dict>
</dict>
</dict>
</array>
</dict>
</plist>
"""

products = {
# "HipChat" : "com.hipchat.HipChat",
# "Bartender" : "com.surteesstudio.Bartender",
# "Fake" : "com.fakeapp.Fake",
# "Fluid" : "com.fluidapp.FluidApp",
# "Cinch" : "com.irradiatedsoftware.cinch",
# "iTeleport" : "com.iteleport.iteleportformac",
# "Limechat" : "net.limechat.limechat",
# "Mactracker" : "com.mactrackerapp.Mactracker",
# "Pacifist" : "com.charlessoft.pacifist",
# "LingonX" : "com.peterborgapps.LingonX",
# "MarsEdit" : "com.red-sweater.marsedit",
# "ScreenSharingMenulet" : "com.klieme.ScreenSharingMenulet"}
"Reflector" : "com.squirrels.Reflection",
"Isolator" : "eu.willmore.isolator",
"ClipMenu" : "com.naotaka.ClipMenu"}
# "TheUnarchiver" : "com.github.autopkg.download.TheUnarchiver", "XQuartz" : "com.github.autopkg.download.xquartz"
"LibreOffice" : "org.libreoffice.script"}
filename = "/tmp/scratch"
for product_name, identifier in products.items():
new_string = template_string.replace("%producto%", product_name)
Expand Down

0 comments on commit 223853c

Please sign in to comment.