Skip to content

Commit

Permalink
Support packaging of binaries
Browse files Browse the repository at this point in the history
    new file:   donation.txt
    new file:   os2compat.txt
    new file:   pack.cmd
  • Loading branch information
komh committed Jan 16, 2022
1 parent ac6d98c commit 6ca4bf6
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 0 deletions.
14 changes: 14 additions & 0 deletions donation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

Donation
--------

If you are satisfied with this program and want to donate to me, please visit
the following URL.

http://www.os2.kr/komh/os2factory/

Or, please click the Ads in the following blog.

https://lvzuufx.blogspot.com/

KO Myung-Hun
25 changes: 25 additions & 0 deletions os2compat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Upload Information Template for Hobbes.nmsu.edu
===============================================

Archive Filename: os2compat-@[email protected]
Short Description: os2compat v@VER@
Long Description: os2compat v@VER@
Supplementary library for missing features in OS/2 kLIBC.

Proposed directory
for placement: /pub/os2/dev/unix

Your name: KO Myung-Hun
Email address: [email protected]
Program contact name: (same)
Program contact email: (same)
Program URL: https://github.com/komh/os2compat

Would you like the
contact email address
included in listings? yes

Operating System/Version:
Additional requirements: kLIBC v0.6.6

Replaces: (none)
81 changes: 81 additions & 0 deletions pack.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* pack.cmd to package a project using GNU Make/GCC build system and git */

call setlocal

/****** Configuration parts begin ******/

sPackageName = 'os2compat'
sRepoDir = '.'

sVerMacro = ''
sVerHeader = ''

sDistFiles = 'README' '/',
'donation.txt' '/'

/****** Configuration parts end ******/

'echo' 'on'

sCmd = 'sh' '-c' '"date +%%y.%%m.%%d"'
sVer = getOutput( sCmd )
sPackageNameVer = sPackageName || '-' || sVer

'sed' '-e' 's/@VER@/' || sVer || '/g',
sPackageName || '.txt' '>' sPackageNameVer || '.txt'

sDistFiles = sDistFiles,
sPackageNameVer || '.txt' '/.'

'mkdir' sPackageNameVer

'gmake' 'clean'
'gmake' 'RELEASE=1'
'gmake' 'install' 'PREFIX=/usr' 'DESTDIR=' || sPackageNameVer

do while strip( sDistFiles ) \= ''
parse value sDistFiles with sSrc sDestDir sDistFiles

'ginstall' '-d' sPackageNameVer || sDestDir
'ginstall' sRepoDir || '/' || sSrc sPackageNameVer || sDestDir
end

'git' 'tag' '-d' sVer '>nul' '2>&1'
'git' 'tag' '-a' '-m' '"tag v' || sVer || '"' sVer

'git' 'archive' '--format' 'zip' sVer '--prefix' sPackageNameVer || '/' '>',
sPackageNameVer || '/' || sPackageNameVer || '-src.zip'

'rm' '-f' sPackageNameVer || '.zip'
'zip' '-rpSm' sPackageNameVer || '.zip' sPackageNameVer

call endlocal

exit 0

/* Get outputs from commands */
getOutput: procedure
parse arg sCmd

nl = x2c('d') || x2c('a')

rqNew = rxqueue('create')
rqOld = rxqueue('set', rqNew )

address cmd sCmd '| rxqueue' rqNew

sResult = ''
do while queued() > 0
parse pull sLine
sResult = sResult || sLine || nl
end

call rxqueue 'Delete', rqNew
call rxqueue 'Set', rqOld

/* Remove empty lines at end */
do while right( sResult, length( nl )) = nl
sResult = delstr( sResult, length( sResult ) - length( nl ) + 1 )
end

return sResult

0 comments on commit 6ca4bf6

Please sign in to comment.