File HOWTO-generate_package_source_and_spec of Package iobroker

Describe how to build package.spec package.source.
==================================================
Attention: 
- Don't know why, but speculate generates errors 
  when directory to long or include special signs.
- You must run for nodejs6 and nodejs8 with npm6 AND npm8.
  Don't use nodejs10.
- package-local.json exists only at npm8

Packages needed:
 nodejs
 gcc-c++


NEW:

run ./get_source <version>
osc build


OLD:
=====
1. install iobroker and speculate
  1.1 npm6 install --save iobroker AND 
      npm8 install --save iobroker
  1.2 npm6 install --save-dev speculate AND 
      npm8 install --save-dev speculate
  
2. change package.json and package-local.json  
  2.1 Change iobroker.inst to iobroker.nodejs6 and iobroker.nodejs8
  2.2 npm audit
  2.2.1 Put listed dependencis in package-local.json like:

     {
       "name": "iobroker.inst",
       "version": "1.1.2",
       "lockfileVersion": 1,
       "requires": true,
       "dependencies": {
  
  
         "iobroker.admin": {
           "version": "3.4.7"
         },
         "iobroker.discovery": {
           "version": "1.2.1"
         },
         "iobroker.js-controller": {
           "version": "1.4.2"
         },
         "speculate": {
           "version": "1.7.4"
         },
        
    
         "ansi-regex": {
           "version": "2.1.1",

      Test with npm audit if ok now.
           
           
  2.2.2  Put speculate as script in package.json like:

     {
       "name": "iobroker.inst",
       "version": "1.1.2",
       "private": true,
       "description": "Automation platform in node.js",
       "dependencies": {
         "iobroker": "^1.1.2",
         "iobroker.admin": "^3.4.7",
         "iobroker.discovery": "^1.2.1",
         "iobroker.js-controller": "^1.4.2"
       },
       "devDependencies": {
         "speculate": "^1.7.4"
       },
        "scripts": {
         "spec": "speculate"
       }
     }


     
3. change absolute Path in _where
   find . -type f -exec sed -i -e 's|<path of your dir. see with pwd>|/srv/iobroker|g' package.json {} \;
   find . -type f -exec sed -i -e 's|<your homedir path>|/srv/iobroker|g' package.json {} \;

4. npm6 run spec AND
   npm8 run spec

Now you have spec and source.
openSUSE Build Service is sponsored by