pkg_noisrev 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,222 @@
1
+ # :erb:
2
+ require 'yaml'
3
+ require 'shellwords.rb'
4
+ require 'optparse'
5
+ require 'pp'
6
+ require 'open4'
7
+
8
+ require_relative 'meta'
9
+
10
+ # :include: ../../README.rdoc
11
+ module Pkg_noisrev
12
+
13
+ class Trestle
14
+
15
+ # Execute _cmd_ and return a list [exit_status, stderr,
16
+ # stdout]. Very handy.
17
+ def self.cmd_run(cmd)
18
+ so = sr = ''
19
+ status = Open4::popen4(cmd) { |pid, stdin, stdout, stderr|
20
+ so = stdout.read
21
+ sr = stderr.read
22
+ }
23
+ [status.exitstatus, sr, so]
24
+ end
25
+
26
+ # Return a directory with program libraries.
27
+ def self.gem_libdir
28
+ t = ["#{File.dirname(File.realpath($0))}/../lib/#{Pkg_noisrev::Meta::NAME}",
29
+ "#{Gem.dir}/gems/#{Pkg_noisrev::Meta::NAME}-#{Pkg_noisrev::Meta::VERSION}/lib/#{Pkg_noisrev::Meta::NAME}",
30
+ "lib/#{Pkg_noisrev::Meta::NAME}"]
31
+ t.each {|i| return i if File.readable?(i) }
32
+ fail "all paths are invalid: #{t}"
33
+ end
34
+
35
+ # Analogue to shell command +which+.
36
+ def self.in_path?(file)
37
+ return true if file =~ %r%\A/% and File.exist? file
38
+
39
+ ENV['PATH'].split(File::PATH_SEPARATOR).any? do |path|
40
+ File.exist? File.join(path, file)
41
+ end
42
+ end
43
+
44
+ # Print an error message _t_ and exit if _ec_ > 0.
45
+ def self.errx(ec, t)
46
+ $stderr.puts File.basename($0) + ' error: ' + t.to_s
47
+ exit ec if ec > 0
48
+ end
49
+
50
+ # Print a warning.
51
+ def self.warnx(t)
52
+ $stderr.puts File.basename($0) + ' warning: ' + t.to_s
53
+ end
54
+
55
+ # #veputs uses this to decide to put a newline or not to put.
56
+ NNL_MARK = '__NNL__'
57
+
58
+ # Use this in your CL options to check if modifying some variable is
59
+ # not an idempotent act.
60
+ attr_reader :cl_opt_protect
61
+
62
+ # [conf] Typically must be a reference to some global variable.
63
+ def initialize(conf)
64
+ @conf = conf
65
+ @conf[:verbose] = 0
66
+ @conf[:banner] = "Usage: #{File.basename($0)} [options]"
67
+ @conf[:config] = Meta::NAME + '.yaml'
68
+ @conf[:config_dirs] = [ENV['HOME']+'/.'+Meta::NAME,
69
+ File.absolute_path("#{File.dirname(File.realpath($0))}/../etc"),
70
+ '/usr/etc', '/usr/local/etc', '/etc',
71
+ "#{Gem.dir}/gems/#{Meta::NAME}-#{Meta::VERSION}/etc"
72
+ ]
73
+ @conf[:config_env] = [Meta::NAME.upcase + '_CONF']
74
+
75
+ @cl_parsing_times = 0 # not used
76
+ @cl_opt_protect = false
77
+ end
78
+
79
+ # [level] A verbose level.
80
+ # [t] A string to print.
81
+ #
82
+ # Don't print _t_ with a newline if it contains NNL_MARK at the end.
83
+ def veputs(level, t)
84
+ t = t.dup
85
+ nnl = nil
86
+ if t.match(/#{NNL_MARK}$/)
87
+ t.sub!(/#{$&}/, '')
88
+ nnl = 1
89
+ end
90
+
91
+ if @conf[:verbose] >= level
92
+ nnl ? print(t) : print("#{t}\n")
93
+ $stdout.flush
94
+ end
95
+ end
96
+
97
+ # Run all configuration parsing in a batch.
98
+ #
99
+ # [rvars] A list of variable names which must be in the
100
+ # configuration file.
101
+ #
102
+ # If no block is given, only standard CL options will be analysed.
103
+ def config_parse(rvars, &block)
104
+ cb = ->(b, src) {
105
+ if b
106
+ block.call src
107
+ else
108
+ # very basic default options
109
+ cl_parse(src, nil, true)
110
+ end
111
+ }
112
+
113
+ # 1. parse env
114
+ @conf[:config_env].each {|i|
115
+ # puts '0 run:'
116
+ cb.call(block_given?, ENV[i].shellsplit) if ENV.key?(i)
117
+ }
118
+
119
+ # 2. parse CL in case of '--config' option
120
+ # puts "\n1 run"
121
+ @cl_opt_protect = true
122
+ cb.call(block_given?, ARGV.dup)
123
+ @cl_opt_protect = false
124
+
125
+ # 3. load the configuration file & do the final CL parsing
126
+ begin
127
+ # puts "\n2 run"
128
+ r = config_flat_load(rvars)
129
+ rescue
130
+ Trestle.errx(1, "cannot load config: #{$!}")
131
+ end
132
+ veputs(1, "Loaded config: #{r}")
133
+ cb.call(block_given?, ARGV)
134
+ end
135
+
136
+ # Load a config file immediately if it contains '/' in its name,
137
+ # otherwise search through several dirs for it.
138
+ #
139
+ # [rvars] a list of requied variables in the config
140
+ #
141
+ # Return a loaded filename or nil on error.
142
+ def config_flat_load(rvars)
143
+ p = ->(f) {
144
+ if File.readable?(f)
145
+ begin
146
+ myconf = YAML.load_file(f)
147
+ rescue
148
+ abort("cannot parse #{f}: #{$!}")
149
+ end
150
+ rvars.each { |i|
151
+ fail "missing or nil '#{i}' in #{f}" if ! myconf.key?(i.to_sym) || ! myconf[i.to_sym]
152
+ }
153
+ @conf.merge!(myconf)
154
+ return @conf[:config]
155
+ end
156
+ return nil
157
+ }
158
+
159
+ if @conf[:config].index('/')
160
+ return p.call(@config[:config])
161
+ else
162
+ @conf[:config_dirs].each {|dir|
163
+ return dir+'/'+@conf[:config] if p.call(dir + '/' + @conf[:config])
164
+ }
165
+ end
166
+
167
+ return nil
168
+ end
169
+
170
+
171
+ # Parses CL-like options.
172
+ #
173
+ # [src] An array of options (usually +ARGV+).
174
+ #
175
+ # If _o_ is non nil function parses _src_ immediately, otherwise it
176
+ # only creates +OptionParser+ object and return it (if _simple_ is
177
+ # false).
178
+ def cl_parse(src, o = nil, simple = false)
179
+ if ! o then
180
+ # puts "NEW o (#{cl_opt_protect})" + src.to_s
181
+ o = OptionParser.new
182
+ o.banner = @conf[:banner]
183
+ o.on('-v', 'Be more verbose.') { |i|
184
+ # puts "cl_parsing_times "+cl_parsing_times.to_s
185
+ @conf[:verbose] += 1 unless cl_opt_protect
186
+ }
187
+ o.on('-V', 'Show version & exit.') { |i|
188
+ puts Meta::VERSION
189
+ exit 0
190
+ }
191
+ o.on('--config NAME', "Set a config name (default is #{@conf[:config]}).") {|i|
192
+ @conf[:config] = i
193
+ }
194
+ o.on('--config-dirs', 'Show possible config locations.') {
195
+ @conf[:config_dirs].each { |j|
196
+ f = j + '/' + @conf[:config]
197
+ puts (File.readable?(f) ? '* ' : ' ') + f
198
+ }
199
+ exit 0
200
+ }
201
+
202
+ return o if ! simple
203
+ end
204
+
205
+ begin
206
+ o.parse!(src)
207
+ @cl_parsing_times += 1
208
+ rescue
209
+ Trestle.errx(1, $!.to_s)
210
+ end
211
+ end
212
+
213
+ # A handy proc that return a nice formatted current global
214
+ # backtrace.
215
+ def self.get_backtrace
216
+ "#{$!}\n\nBacktrace:\n\n#{$!.backtrace.join("\n")}"
217
+ end
218
+
219
+ end # trestle
220
+ end
221
+
222
+ # Don't remove this: falsework/0.2.7/naive/2011-07-17T01:52:43+03:00
data/test/helper.rb ADDED
@@ -0,0 +1,10 @@
1
+ # This is supposed to be your helper for all your test. Feel free to
2
+ # add staff here.
3
+
4
+ require_relative 'helper_trestle'
5
+
6
+ require 'pathname'
7
+ require 'digest/md5'
8
+
9
+ PKG_DIR = Pathname.new 'semis/package'
10
+ PORTS_DIR = Pathname.new 'semis/ports'
@@ -0,0 +1,34 @@
1
+ # :erb:
2
+ # Various staff for minitest. Include this file into your 'helper.rb'.
3
+
4
+ require 'fileutils'
5
+ include FileUtils
6
+
7
+ require_relative '../lib/pkg_noisrev/trestle'
8
+ include Pkg_noisrev
9
+
10
+ require 'minitest/autorun'
11
+
12
+ # Return an absolute path of a _c_.
13
+ def cmd(c)
14
+ case File.basename(Dir.pwd)
15
+ when Meta::NAME.downcase
16
+ # test probably is executed from the Rakefile
17
+ Dir.chdir('test')
18
+ STDERR.puts('*** chdir to ' + Dir.pwd)
19
+ when 'test'
20
+ # we are in the test directory, there is nothing special to do
21
+ else
22
+ # tests were invoked by 'gem check -t pkg_noisrev'
23
+ # (for a classic rubygems 1.3.7)
24
+ begin
25
+ Dir.chdir(Trestle.gem_libdir + '/../../test')
26
+ rescue
27
+ raise "running tests from '#{Dir.pwd}' isn't supported: #{$!}"
28
+ end
29
+ end
30
+
31
+ File.absolute_path('../bin/' + c)
32
+ end
33
+
34
+ # Don't remove this: falsework/0.2.7/naive/2011-07-17T01:52:43+03:00
data/test/rake_git.rb ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ # -*-ruby-*-
3
+ # :erb:
4
+
5
+ # This is a helper for your Rakefile. Read the comments for each
6
+ # function.
7
+
8
+ require 'git'
9
+ require 'pp'
10
+
11
+ # Return a list of files in a git repository _repdir_.
12
+ #
13
+ # Add this to your gem spec:
14
+ #
15
+ # spec = Gem::Specification.new {|i|
16
+ # i.files = git_ls('.')
17
+ # }
18
+ #
19
+ # What it does is just collecting the list of the files from the git
20
+ # repository. The idea is to use that list for the gem spec. No more
21
+ # missing or redundant files in gems!
22
+ def git_ls(repdir, ignore_some = true)
23
+ ignore = ['/?\.gitignore$']
24
+
25
+ r = []
26
+ g = Git.open repdir
27
+ g.ls_files.each {|i, v|
28
+ next if ignore_some && ignore.index {|ign| i.match(/#{ign}/) }
29
+ r << i
30
+ }
31
+ r
32
+ end
33
+
34
+ pp git_ls('.') if __FILE__ == $0
35
+
36
+ # Don't remove this: falsework/0.2.7/naive/2011-07-17T01:52:43+03:00
File without changes
@@ -0,0 +1 @@
1
+ A Motif tool for editing X11 bitmap fonts
@@ -0,0 +1,47 @@
1
+ @comment PKG_FORMAT_REVISION:1.1
2
+ @name xmbdfed-4.7.1_2
3
+ @comment ORIGIN:x11-fonts/xmbdfed
4
+ @cwd /usr/local
5
+ @pkgdep xextproto-7.1.1
6
+ @comment DEPORIGIN:x11/xextproto
7
+ @pkgdep xbitmaps-1.1.0
8
+ @comment DEPORIGIN:x11/xbitmaps
9
+ @pkgdep printproto-1.0.4
10
+ @comment DEPORIGIN:x11/printproto
11
+ @pkgdep kbproto-1.0.5
12
+ @comment DEPORIGIN:x11/kbproto
13
+ @pkgdep pkg-config-0.25_1
14
+ @comment DEPORIGIN:devel/pkg-config
15
+ @pkgdep freetype2-2.4.4
16
+ @comment DEPORIGIN:print/freetype2
17
+ @pkgdep xproto-7.0.16
18
+ @comment DEPORIGIN:x11/xproto
19
+ @pkgdep libXdmcp-1.0.3
20
+ @comment DEPORIGIN:x11/libXdmcp
21
+ @pkgdep libXau-1.0.6
22
+ @comment DEPORIGIN:x11/libXau
23
+ @pkgdep libX11-1.3.6,1
24
+ @comment DEPORIGIN:x11/libX11
25
+ @pkgdep libXext-1.1.2,1
26
+ @comment DEPORIGIN:x11/libXext
27
+ @pkgdep libXp-1.0.0,1
28
+ @comment DEPORIGIN:x11/libXp
29
+ @pkgdep libICE-1.0.7,1
30
+ @comment DEPORIGIN:x11/libICE
31
+ @pkgdep libSM-1.1.1_3,1
32
+ @comment DEPORIGIN:x11/libSM
33
+ @pkgdep libXt-1.0.9
34
+ @comment DEPORIGIN:x11-toolkits/libXt
35
+ @pkgdep libXpm-3.5.7
36
+ @comment DEPORIGIN:x11/libXpm
37
+ @pkgdep libXmu-1.1.0,1
38
+ @comment DEPORIGIN:x11-toolkits/libXmu
39
+ @pkgdep libXaw-1.0.8,1
40
+ @comment DEPORIGIN:x11-toolkits/libXaw
41
+ @pkgdep open-motif-2.2.3_6
42
+ @comment DEPORIGIN:x11-toolkits/open-motif
43
+ bin/xmbdfed
44
+ @comment MD5:70fe0a284a6ef3c16d89ce9343f3fa48
45
+ man/man1/xmbdfed.1.gz
46
+ @comment MD5:1fded0314bd85a5f8b97f721307867d4
47
+ @unexec rm -f %D/man/cat1/xmbdfed.1.gz %D/man/cat1/xmbdfed.1 %D/man/cat1/xmbdfed.1.gz %D/man/cat1/xmbdfed.1.gz.gz %D/man/cat1/xmbdfed.1.gz.bz2
@@ -0,0 +1 @@
1
+ Create/update ZIP files compatible with pkzip
@@ -0,0 +1,35 @@
1
+ @comment PKG_FORMAT_REVISION:1.1
2
+ @name zip-3.0
3
+ @comment ORIGIN:archivers/zip
4
+ @cwd /usr/local
5
+ bin/zip
6
+ @comment MD5:3356288637a40b57a91a4d6aba569b8f
7
+ bin/zipcloak
8
+ @comment MD5:d25af327a58289224643a1f1e32c6c0f
9
+ bin/zipnote
10
+ @comment MD5:5ede5ea2b1b66ef6df0c4d7273cfcfde
11
+ bin/zipsplit
12
+ @comment MD5:66b8dcf4c82efb83d01ae69701802de3
13
+ man/man1/zip.1.gz
14
+ @comment MD5:ccd5f71cfb25c09e0d5a59e125f4cf5f
15
+ man/man1/zipcloak.1.gz
16
+ @comment MD5:a585a8020b0a0f030e59b0274299c497
17
+ man/man1/zipnote.1.gz
18
+ @comment MD5:f71924cc4f2cce23806f386984c2a3bc
19
+ man/man1/zipsplit.1.gz
20
+ @comment MD5:1720d6f12a3407bae4a319c16d322757
21
+ @unexec rm -f %D/man/cat1/zip.1.gz %D/man/cat1/zip.1 %D/man/cat1/zip.1.gz %D/man/cat1/zip.1.gz.gz %D/man/cat1/zip.1.gz.bz2
22
+ @unexec rm -f %D/man/cat1/zipcloak.1.gz %D/man/cat1/zipcloak.1 %D/man/cat1/zipcloak.1.gz %D/man/cat1/zipcloak.1.gz.gz %D/man/cat1/zipcloak.1.gz.bz2
23
+ @unexec rm -f %D/man/cat1/zipnote.1.gz %D/man/cat1/zipnote.1 %D/man/cat1/zipnote.1.gz %D/man/cat1/zipnote.1.gz.gz %D/man/cat1/zipnote.1.gz.bz2
24
+ @unexec rm -f %D/man/cat1/zipsplit.1.gz %D/man/cat1/zipsplit.1 %D/man/cat1/zipsplit.1.gz %D/man/cat1/zipsplit.1.gz.gz %D/man/cat1/zipsplit.1.gz.bz2
25
+ @cwd .
26
+ @ignore
27
+ +COMMENT
28
+ @comment MD5:482c7883e97f4796b330265d21664958
29
+ @ignore
30
+ +DESC
31
+ @comment MD5:68ae0f4079192bc009133a979d1022c5
32
+ @ignore
33
+ +MTREE_DIRS
34
+ @comment MD5:219b9fb84bdcc9c6d574c11ea5a3efd9
35
+ @mtree +MTREE_DIRS
@@ -0,0 +1 @@
1
+ firefox-4.0,1
@@ -0,0 +1,23 @@
1
+ # MOVED -- A list of (recently) moved or removed ports
2
+ #
3
+ # Each entry consists of a single line containing the following four
4
+ # fields in the order named, separated with the pipe (`|') character:
5
+ #
6
+ # Port: A port that was moved (category/portname)
7
+ # Moved to: Where the port was moved to, or which port users can
8
+ # and should migrate to (category/portname); no entry
9
+ # indicates that the port was deleted
10
+ # Date: When the moving or the removal was done (YYYY-MM-DD,
11
+ # in PST/PDT)
12
+ # Why: The reason why the port was moved or removed
13
+ #
14
+ # Port|Moved to|Date|Why
15
+
16
+ mail/claws-mail-clamav||2009-02-03|Has expired: has been broken for more than 6 months
17
+ x11-fonts/xmbdfed||2011-05-02|Has expired: Upstream disapear and distfile is no more available
18
+ audio/dap||2011-05-02|Has expired: Upstream disapear and distfile is no more available
19
+ audio/gdrdao||2011-05-02|Has expired: Upstream disapear and no more distfiles available
20
+
21
+ databases/gmysql||2011-05-02|Has expired: Upstream disapear and distfile is no more available
22
+ deskutils/kuake||2011-05-02|Has expired: Upstream disapear and distfile is no more available
23
+ science/bblimage|science/pyvox|2011-07-28|track the upstream name change
@@ -0,0 +1,35 @@
1
+ # New ports collection makefile for: zip
2
+ # Date created: 22 Dec 1994
3
+ # Whom: ache
4
+ #
5
+ # $FreeBSD: ports/archivers/zip/Makefile,v 1.39 2009/08/22 00:12:56 amdmi3 Exp $
6
+ #
7
+
8
+ PORTNAME= zip
9
+ PORTVERSION= 3.0
10
+ CATEGORIES= archivers
11
+ MASTER_SITES= SF/info${PORTNAME}/Zip%203.x%20%28latest%29/${PORTVERSION}
12
+ DISTFILES= ${PORTNAME}30${EXTRACT_SUFX}
13
+ USE_ZIP= yes
14
+
15
+ MAINTAINER= ache@FreeBSD.org
16
+ COMMENT= Create/update ZIP files compatible with pkzip
17
+
18
+ WRKSRC= ${WRKDIR}/${PORTNAME}30
19
+ MAKEFILE= unix/Makefile
20
+ ALL_TARGET= generic
21
+ MAN1= zip.1 zipcloak.1 zipnote.1 zipsplit.1
22
+
23
+ PLIST_FILES= \
24
+ bin/zip \
25
+ bin/zipcloak \
26
+ bin/zipnote \
27
+ bin/zipsplit
28
+
29
+ do-install:
30
+ .for file in zip zipcloak zipnote zipsplit
31
+ ${INSTALL_PROGRAM} ${WRKSRC}/${file} ${PREFIX}/bin
32
+ ${INSTALL_MAN} ${WRKSRC}/man/${file}.1 ${PREFIX}/man/man1
33
+ .endfor
34
+
35
+ .include <bsd.port.mk>